Fixed refresh bugs when drag'n dropping of group of elements
authorLaurent Bessard
Thu, 25 Apr 2013 09:39:03 +0200
changeset 1069 880ec628d490
parent 1068 ef088254ba4b
child 1070 86ee833e33ef
Fixed refresh bugs when drag'n dropping of group of elements
editors/Viewer.py
graphics/GraphicCommons.py
--- a/editors/Viewer.py	Thu Apr 25 09:37:56 2013 +0200
+++ b/editors/Viewer.py	Thu Apr 25 09:39:03 2013 +0200
@@ -1941,6 +1941,7 @@
                     movex, movey = self.SelectedElement.OnMotion(event, dc, self.Scaling)
                     if movex != 0 or movey != 0:
                         self.RefreshRect(self.GetScrolledRect(self.SelectedElement.GetRedrawRect(movex, movey)), False)
+                    self.RefreshVisibleElements()
             elif self.Debug and self.StartMousePos is not None and event.Dragging():
                 pos = event.GetPosition()
                 if abs(self.StartMousePos.x - pos.x) > 5 or abs(self.StartMousePos.y - pos.y) > 5:
--- a/graphics/GraphicCommons.py	Thu Apr 25 09:37:56 2013 +0200
+++ b/graphics/GraphicCommons.py	Thu Apr 25 09:39:03 2013 +0200
@@ -1497,6 +1497,10 @@
         for element in self.Elements:
             element.RefreshModel(move)
 
+    # Draws the handles of this element if it is selected
+    def Draw(self, dc):
+        for element in self.Elements:
+            element.Draw(dc)
 
 #-------------------------------------------------------------------------------
 #                         Connector for all types of blocks