Fix bug with SFC Divergence while loading a POU
authorLaurent Bessard
Wed, 01 Aug 2012 12:44:06 +0200
changeset 736 eb6b13d87bfc
parent 735 99699ca6eda4
child 737 85a4bc7dc31e
Fix bug with SFC Divergence while loading a POU
Viewer.py
--- a/Viewer.py	Wed Aug 01 12:43:23 2012 +0200
+++ b/Viewer.py	Wed Aug 01 12:44:06 2012 +0200
@@ -1171,6 +1171,9 @@
         else:
             self.AddBlock(element)
             connectors = element.GetConnectors()
+        if isinstance(element, SFC_Divergence):
+            element.SetPosition(instance["x"], instance["y"])
+            element.SetSize(instance["width"], instance["height"])
         for i, input_connector in enumerate(instance["inputs"]):
             if i < len(connectors["inputs"]):
                 connector = connectors["inputs"][i]
@@ -1188,8 +1191,9 @@
                 if output_connector.get("edge", "none") != "none":
                     connector.SetEdge(output_connector["edge"])
                 connector.SetPosition(wx.Point(*output_connector["position"]))
-        element.SetPosition(instance["x"], instance["y"])
-        element.SetSize(instance["width"], instance["height"])
+        if not isinstance(element, SFC_Divergence):
+            element.SetPosition(instance["x"], instance["y"])
+            element.SetSize(instance["width"], instance["height"])
         if selection is not None and selection[0].get(instance["id"], False):
             self.SelectInGroup(element)