Adding support for preventing expending graphical element to have a negative position
authorlbessard
Mon, 23 Mar 2009 16:42:02 +0100
changeset 334 cf0809bc5675
parent 333 0a74fcfd4d03
child 335 c2c6db53a04f
Adding support for preventing expending graphical element to have a negative position
graphics/GraphicCommons.py
--- a/graphics/GraphicCommons.py	Fri Mar 20 16:36:13 2009 +0100
+++ b/graphics/GraphicCommons.py	Mon Mar 23 16:42:02 2009 +0100
@@ -617,6 +617,7 @@
                 if scaling is not None:
                     movex = round_scaling(width + movex, scaling[0]) - width
                 if event.ShiftDown():
+                    movex = min(self.BoundingBox.x, movex)
                     x = -movex
                     width += 2 * movex
                 else:
@@ -634,6 +635,7 @@
                 if scaling is not None:
                     movey = round_scaling(height + movey, scaling[1]) - height
                 if event.ShiftDown():
+                    movey = min(self.BoundingBox.y, movey)
                     y = -movey
                     height += 2 * movey
                 else: