graphics/GraphicCommons.py
changeset 667 baab9eb5b8ad
parent 666 d4bb66691248
child 679 91e8ff268e96
--- a/graphics/GraphicCommons.py	Sat Mar 31 15:08:18 2012 +0200
+++ b/graphics/GraphicCommons.py	Sun Apr 01 15:51:39 2012 +0200
@@ -933,8 +933,8 @@
 
     # Moves the element
     def Move(self, dx, dy, exclude = []):
-        self.Pos.x += dx
-        self.Pos.y += dy
+        self.Pos.x += max(-self.BoundingBox.x, dx)
+        self.Pos.y += max(-self.BoundingBox.y, dy)
         self.RefreshConnected(exclude)
         self.RefreshBoundingBox()
     
@@ -1311,6 +1311,8 @@
     
     # Move this group of elements
     def Move(self, movex, movey):
+        movex = max(-self.BoundingBox.x, movex)
+        movey = max(-self.BoundingBox.y, movey)
         # Move all the elements of the group
         for element in self.Elements:
             if not isinstance(element, Wire):