From: Jussi Koskela Date: Thu, 2 Jul 2020 12:39:27 +0000 (+0300) Subject: Fixed incorrect calculation of monitor bounding box (prefix + suffix) X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=5c99f2442251c09d06c6ac52ba95fa2ec8645c75;p=simantics%2Fplatform.git Fixed incorrect calculation of monitor bounding box (prefix + suffix) gitlab #152 Change-Id: I0a5f2ea2371b053a28aaa3e521910c7a93d18333 --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/MonitorClass.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/MonitorClass.java index 080f6b9c4..fd1498d0c 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/MonitorClass.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/elements/MonitorClass.java @@ -602,14 +602,14 @@ public class MonitorClass { } TextNode prefixNode = (TextNode) e.getHint(KEY_SG_PREFIX_NODE); if (prefixNode != null) { - Rectangle2D bounds = prefixNode.getBoundsInLocal(); + Rectangle2D bounds = node.parentToLocal(prefixNode.localToParent(prefixNode.getBoundsInLocal())); if (size == null) size = new Rectangle2D.Double(0, 0, 0, 0); size.add(bounds); } TextNode suffixNode = (TextNode) e.getHint(KEY_SG_SUFFIX_NODE); if (suffixNode != null) { - Rectangle2D bounds = suffixNode.getBoundsInLocal(); + Rectangle2D bounds = node.parentToLocal(suffixNode.localToParent(suffixNode.getBoundsInLocal())); if (size == null) size = new Rectangle2D.Double(0, 0, 0, 0); size.add(bounds);