From 1cd1b488690ff3007df258adbfb198f5bdedfb80 Mon Sep 17 00:00:00 2001
From: Antonio Ospite <ao2@ao2.it>
Date: Tue, 26 Jun 2018 16:15:36 +0200
Subject: [PATCH] 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.
---
 src/diagram/svgwrite_diagram.py | 3 +++
 1 file changed, 3 insertions(+)

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
-- 
2.1.4