Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-10-11 21:16:21 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-10-11 21:16:21 (GMT)
commit6d18312e476d7f2e96d8aff9157d85d055f3c605 (patch)
tree9ba7835f144fe2a7179e7b11655e148283de076f /tawindow.py
parent41a74a0736a66506026e85323dcc7d61dc7e9bd2 (diff)
prevent blocks from going off the left edge
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tawindow.py b/tawindow.py
index 9cbb9db..5e7fcae 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -344,6 +344,11 @@ def mouse_move(tw, x, y, verbose=False, mdx=0, mdy=0):
tw.draggroup = findgroup(find_top_block(spr))
else:
tw.draggroup = findgroup(spr)
+ # check to see if any block ends up with a negative x
+ for b in tw.draggroup:
+ if b.x+dx < 0:
+ dx += -(b.x+dx)
+ # move the stack
for b in tw.draggroup:
move(b,(b.x+dx, b.y+dy))
elif spr.type=='turtle':