From: Antonio Ospite Date: Tue, 26 Jun 2018 14:15:36 +0000 (+0200) Subject: svgwrite_diagram: return "something" from draw_centered_text() X-Git-Url: https://git.ao2.it/flexagon-toolkit.git/commitdiff_plain/1cd1b488690ff3007df258adbfb198f5bdedfb80?ds=sidebyside svgwrite_diagram: return "something" from draw_centered_text() 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. --- diff --git a/src/diagram/svgwrite_diagram.py b/src/diagram/svgwrite_diagram.py index c4b76af..186d134 100755 --- 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