From: Jussi Koskela Date: Tue, 16 May 2017 05:23:41 +0000 (+0300) Subject: Calculating bounding box for dynamic symbol fails for empty TSpan X-Git-Tag: v1.29.0~43 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F29%2F529%2F1;p=simantics%2Fplatform.git Calculating bounding box for dynamic symbol fails for empty TSpan Replace empty content with dash as a workaround. refs #7231 Change-Id: Iac8257d12d4a6201f766a7458c6315ab5e84f113 --- diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SVGNode.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SVGNode.java index cdd6a2645..2dd285fd8 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SVGNode.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/SVGNode.java @@ -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();