# HG changeset patch # User lbessard # Date 1237822922 -3600 # Node ID cf0809bc5675ce368000b508d132db912570c7af # Parent 0a74fcfd4d03a65d3575199a1a798b5d3f4c0c05 Adding support for preventing expending graphical element to have a negative position diff -r 0a74fcfd4d03 -r cf0809bc5675 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: