graphics/GraphicCommons.py
changeset 667 baab9eb5b8ad
parent 666 d4bb66691248
child 679 91e8ff268e96
equal deleted inserted replaced
666:d4bb66691248 667:baab9eb5b8ad
   931             wx.CallAfter(self.Parent.SetCurrentCursor, cursor)
   931             wx.CallAfter(self.Parent.SetCurrentCursor, cursor)
   932             return 0, 0
   932             return 0, 0
   933 
   933 
   934     # Moves the element
   934     # Moves the element
   935     def Move(self, dx, dy, exclude = []):
   935     def Move(self, dx, dy, exclude = []):
   936         self.Pos.x += dx
   936         self.Pos.x += max(-self.BoundingBox.x, dx)
   937         self.Pos.y += dy
   937         self.Pos.y += max(-self.BoundingBox.y, dy)
   938         self.RefreshConnected(exclude)
   938         self.RefreshConnected(exclude)
   939         self.RefreshBoundingBox()
   939         self.RefreshBoundingBox()
   940     
   940     
   941     # Resizes the element from position and size given
   941     # Resizes the element from position and size given
   942     def Resize(self, x, y, width, height):
   942     def Resize(self, x, y, width, height):
  1309         self.RefreshWireExclusion()
  1309         self.RefreshWireExclusion()
  1310         self.RefreshBoundingBox()
  1310         self.RefreshBoundingBox()
  1311     
  1311     
  1312     # Move this group of elements
  1312     # Move this group of elements
  1313     def Move(self, movex, movey):
  1313     def Move(self, movex, movey):
       
  1314         movex = max(-self.BoundingBox.x, movex)
       
  1315         movey = max(-self.BoundingBox.y, movey)
  1314         # Move all the elements of the group
  1316         # Move all the elements of the group
  1315         for element in self.Elements:
  1317         for element in self.Elements:
  1316             if not isinstance(element, Wire):
  1318             if not isinstance(element, Wire):
  1317                 element.Move(movex, movey, self.WireExcluded)
  1319                 element.Move(movex, movey, self.WireExcluded)
  1318             elif element in self.WireExcluded:
  1320             elif element in self.WireExcluded: