Fixed bug when quitting project with more than one LD Viewer opened
authorLaurent Bessard
Tue, 30 Apr 2013 10:09:16 +0200
changeset 1081 9789531bc57c
parent 1080 5ec20f56b1d2
child 1082 5a08404d5dda
Fixed bug when quitting project with more than one LD Viewer opened
editors/LDViewer.py
--- a/editors/LDViewer.py	Tue Apr 30 09:49:52 2013 +0200
+++ b/editors/LDViewer.py	Tue Apr 30 10:09:16 2013 +0200
@@ -184,17 +184,17 @@
 
     def RefreshView(self, variablepanel=True, selection=None):
         Viewer.RefreshView(self, variablepanel, selection)
-        wx.CallAfter(self.Refresh)
-        for i, rung in enumerate(self.Rungs):
-            bbox = rung.GetBoundingBox()
-            if i < len(self.RungComments):
-                if self.RungComments[i]:
-                    pos = self.RungComments[i].GetPosition()
-                    if pos[1] > bbox.y:
-                        self.RungComments.insert(i, None)
-            else:
-                self.RungComments.insert(i, None)
-    
+        if self.GetDrawingMode() != FREEDRAWING_MODE:
+            for i, rung in enumerate(self.Rungs):
+                bbox = rung.GetBoundingBox()
+                if i < len(self.RungComments):
+                    if self.RungComments[i]:
+                        pos = self.RungComments[i].GetPosition()
+                        if pos[1] > bbox.y:
+                            self.RungComments.insert(i, None)
+                else:
+                    self.RungComments.insert(i, None)
+        
     def loadInstance(self, instance, ids, selection):
         Viewer.loadInstance(self, instance, ids, selection)
         if self.GetDrawingMode() != FREEDRAWING_MODE: