From: Tuukka Lehtonen Date: Mon, 28 Nov 2016 17:20:29 +0000 (+0200) Subject: Fixed bounds calculation for flags and diagram profile monitors. X-Git-Tag: v1.25.0~24 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=5567c19e0f7ea8aa8ef645422c889a51aeb540f8;p=simantics%2Fplatform.git Fixed bounds calculation for flags and diagram profile monitors. 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 --- diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/TextGridStyle.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/TextGridStyle.java index 6657d5a60..cf3d217c9 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/TextGridStyle.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/TextGridStyle.java @@ -123,7 +123,7 @@ public abstract class TextGridStyle extends StyleBase { String name = getConfigurationComponentNameForElement(graph, element); if (name == null) return null; - AffineTransform transform = DiagramGraphUtil.getAffineTransform(graph, element); + AffineTransform transform = DiagramGraphUtil.getDynamicAffineTransform(graph, runtimeDiagram, element); Vec2d offset = DiagramGraphUtil.getOffset(graph, element); boolean enabled = !DiagramGraphUtil.getProfileMonitorsHidden(graph, element); boolean up = DiagramGraphUtil.getProfileMonitorsUp(graph, element); diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/NodeUtil.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/NodeUtil.java index fb2f485f6..727b98dbc 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/NodeUtil.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/NodeUtil.java @@ -978,9 +978,14 @@ public final class NodeUtil { if(node instanceof ConnectionNode) { return getLocalBounds(node); } else if(node instanceof SingleElementNode) { + // For normal symbols INode image = NodeUtil.findChildByPrefix((SingleElementNode)node, "composite_image"); if (image == null) + // For generic text nodes image = NodeUtil.findChildByPrefix((SingleElementNode) node, "text"); + if (image == null) + // For I/O table diagram flags (value of org.simantics.diagram.flag.FlagSceneGraph.VISUAL_ROOT) + image = NodeUtil.findChildByPrefix((SingleElementNode) node, "visual"); if (image == null) image = NodeUtil.getNearestChildByClass((SingleElementNode) node, FlagNode.class); if (image != null)