]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed incorrect calculation of monitor bounding box (prefix + suffix)
authorJussi Koskela <jussi.koskela@semantum.fi>
Thu, 2 Jul 2020 12:39:27 +0000 (15:39 +0300)
committerAntti Villberg <antti.villberg@semantum.fi>
Wed, 29 Jul 2020 15:16:21 +0000 (18:16 +0300)
gitlab #152

Change-Id: I0a5f2ea2371b053a28aaa3e521910c7a93d18333

bundles/org.simantics.diagram/src/org/simantics/diagram/elements/MonitorClass.java

index 080f6b9c4ee8b5b0924aadf7640fe3265e1f2f09..fd1498d0cac2d33e2fc78ee89c34634bb1f72acb 100644 (file)
@@ -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);