X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Felements%2FTextNode.java;h=bf1bf563b32c9f9e89c2c2355902d2a5b5f1ef02;hp=77eb789220d3118e5d8c370c2889b731450e060f;hb=680a2159d36d893cf7fbf0212e7ffbff847a8f82;hpb=099781f64b56dc39c873bd63bb0b86e9643b7579 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java index 77eb78922..bf1bf563b 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/TextNode.java @@ -403,7 +403,7 @@ public class TextNode extends G2DNode implements IDynamicSelectionPainterNode, L if (hasState(STATE_EDITING)) return; - this.text = new String(text != null ? text : ""); + this.text = text; this.font = font; this.color = color; this.scale = scale; @@ -470,8 +470,8 @@ public class TextNode extends G2DNode implements IDynamicSelectionPainterNode, L // no value => value if(this.text == null && text != null) NodeUtil.decreasePending(this); - this.text = text != null ? text : ""; - caret = Math.min(caret, this.text.length()); + this.text = text; + caret = text != null ? Math.min(caret, text.length()) : 0; selectionTail = caret; resetCaches();