From 6d18312e476d7f2e96d8aff9157d85d055f3c605 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 11 Oct 2009 21:16:21 +0000 Subject: prevent blocks from going off the left edge --- (limited to 'tawindow.py') 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': -- cgit v0.9.1