]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Calculating bounding box for dynamic symbol fails for empty TSpan 29/529/1
authorJussi Koskela <jussi.koskela@semantum.fi>
Tue, 16 May 2017 05:23:41 +0000 (08:23 +0300)
committerJussi Koskela <jussi.koskela@semantum.fi>
Tue, 16 May 2017 05:23:41 +0000 (08:23 +0300)
Replace empty content with dash as a workaround.

refs #7231

Change-Id: Iac8257d12d4a6201f766a7458c6315ab5e84f113

bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SVGNode.java

index cdd6a26458f578d4b30fbe3e5b8099a6191f6550..2dd285fd89d966387d6df759cb365af31740dca5 100644 (file)
@@ -278,7 +278,11 @@ public class SVGNode extends G2DNode implements InitValueSupport, LoaderNode {
                 if ("$text".equals(ass.attributeNameOrId)) {
                     if (e instanceof Tspan) {
                         Tspan t = (Tspan) e;
-                        t.setText(ass.value);
+                        if (ass.value.trim().isEmpty()) {
+                               t.setText("-");
+                        } else {
+                               t.setText(ass.value);
+                        }
                         SVGElement parent = t.getParent();
                         if (parent instanceof Text)
                             ((Text) parent).rebuild();