From ebbf799086d078fac5940a47cda0a6174bcb1b46 Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Tue, 16 May 2017 08:23:41 +0300 Subject: [PATCH] Calculating bounding box for dynamic symbol fails for empty TSpan Replace empty content with dash as a workaround. refs #7231 Change-Id: Iac8257d12d4a6201f766a7458c6315ab5e84f113 --- .../src/org/simantics/scenegraph/g2d/nodes/SVGNode.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); -- 2.47.0