projects
/
flexagon-toolkit.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a09d49b
)
svgwrite_diagram: return "something" from draw_centered_text()
author
Antonio Ospite <ao2@ao2.it>
Tue, 26 Jun 2018 14:15:36 +0000
(16:15 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Wed, 27 Jun 2018 13:18:11 +0000
(15:18 +0200)
Add a quick and dirty way to advance text when calling
draw_centered_text() just for consistency with the cairo backend.
The return value is just a rough estimate, it does not consider the
particular font in use.
src/diagram/svgwrite_diagram.py
patch
|
blob
|
history
diff --git
a/src/diagram/svgwrite_diagram.py
b/src/diagram/svgwrite_diagram.py
index
c4b76af
..
186d134
100755
(executable)
--- a/
src/diagram/svgwrite_diagram.py
+++ b/
src/diagram/svgwrite_diagram.py
@@
-186,3
+186,6
@@
class SvgwriteDiagram(Diagram):
if bb_stroke_color or bb_fill_color:
warnings.warn("Drawing the bounding box has not been implemented yet.")
+
+ # XXX: this is just a very quick and dirty estimate to advance the text
+ return self.font_size * len(text) / 2