fix redraw debug instance tab after transferring new build to PLC. closes #15
authorSurkov Sergey <surkovsv93@gmail.com>
Mon, 06 Feb 2017 20:23:45 +0300
changeset 1652 be605b2e6e3a
parent 1647 13d15a1ae899
child 1653 d98cc9d19a5c
fix redraw debug instance tab after transferring new build to PLC. closes #15
graphics/SFC_Objects.py
--- a/graphics/SFC_Objects.py	Fri Jan 27 16:53:04 2017 +0300
+++ b/graphics/SFC_Objects.py	Mon Feb 06 20:23:45 2017 +0300
@@ -653,8 +653,10 @@
     # Returns the RedrawRect
     def GetRedrawRect(self, movex = 0, movey = 0):
         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
-        rect = rect.Union(self.Input.GetRedrawRect(movex, movey))
-        rect = rect.Union(self.Output.GetRedrawRect(movex, movey))
+        if self.Input:
+            rect = rect.Union(self.Input.GetRedrawRect(movex, movey))
+        if self.Output:
+            rect = rect.Union(self.Output.GetRedrawRect(movex, movey))
         if movex != 0 or movey != 0:
             if self.Input.IsConnected():
                 rect = rect.Union(self.Input.GetConnectedRedrawRect(movex, movey))
@@ -1547,7 +1549,8 @@
     # Returns the RedrawRect
     def GetRedrawRect(self, movex = 0, movey = 0):
         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
-        rect = rect.Union(self.Input.GetRedrawRect(movex, movey))
+        if self.Input:
+            rect = rect.Union(self.Input.GetRedrawRect(movex, movey))
         if movex != 0 or movey != 0:
             if self.Input.IsConnected():
                 rect = rect.Union(self.Input.GetConnectedRedrawRect(movex, movey))
@@ -1824,7 +1827,8 @@
     # Returns the RedrawRect
     def GetRedrawRect(self, movex = 0, movey = 0):
         rect = Graphic_Element.GetRedrawRect(self, movex, movey)
-        rect = rect.Union(self.Input.GetRedrawRect(movex, movey))
+        if self.Input:
+            rect = rect.Union(self.Input.GetRedrawRect(movex, movey))
         if movex != 0 or movey != 0:
             if self.Input.IsConnected():
                 rect = rect.Union(self.Input.GetConnectedRedrawRect(movex, movey))