]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed bounds calculation for flags and diagram profile monitors. 83/183/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 28 Nov 2016 17:20:29 +0000 (19:20 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 28 Nov 2016 17:23:01 +0000 (20:23 +0300)
NodeUtil.getLocalElementBounds did not recognize flag table flags from
the scene graph. Also TextGridStyle.calculateStyle used wrong method for
transform calculation which causes profile monitors to be positioned
incorrectly.

refs #6837
refs #6812
[PRIVATE-12779]
[PRIVATE-8884]

Change-Id: I0700b969347a692ed8d4ff8ec0a5d2c3be781fc1

bundles/org.simantics.diagram/src/org/simantics/diagram/profile/TextGridStyle.java
bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/NodeUtil.java

index 6657d5a60eca5856f3785cb4f77f07197dfa5c5a..cf3d217c9414a89650bb1200529db1bba54a58cf 100644 (file)
@@ -123,7 +123,7 @@ public abstract class TextGridStyle extends StyleBase<MonitorTextGridResult> {
                String name = getConfigurationComponentNameForElement(graph, element);\r
                if (name == null)\r
                        return null;\r
-               AffineTransform transform = DiagramGraphUtil.getAffineTransform(graph, element);\r
+               AffineTransform transform = DiagramGraphUtil.getDynamicAffineTransform(graph, runtimeDiagram, element);\r
                Vec2d offset = DiagramGraphUtil.getOffset(graph, element);\r
                boolean enabled = !DiagramGraphUtil.getProfileMonitorsHidden(graph, element);\r
                boolean up = DiagramGraphUtil.getProfileMonitorsUp(graph, element);\r
index fb2f485f6b5935cc9166a59d9728fbaafd244458..727b98dbc2295eb499a7aad5fee14d5339db1f87 100644 (file)
@@ -978,9 +978,14 @@ public final class NodeUtil {
         if(node instanceof ConnectionNode) {\r
             return getLocalBounds(node);\r
         } else if(node instanceof SingleElementNode) {\r
+            // For normal symbols\r
             INode image = NodeUtil.findChildByPrefix((SingleElementNode)node, "composite_image");\r
             if (image == null)\r
+                // For generic text nodes\r
                 image = NodeUtil.findChildByPrefix((SingleElementNode) node, "text");\r
+            if (image == null)\r
+                // For I/O table diagram flags (value of org.simantics.diagram.flag.FlagSceneGraph.VISUAL_ROOT)\r
+                image = NodeUtil.findChildByPrefix((SingleElementNode) node, "visual");\r
             if (image == null)\r
                 image = NodeUtil.getNearestChildByClass((SingleElementNode) node, FlagNode.class);\r
             if (image != null)\r