Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tautils.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-09-24 01:43:34 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-09-24 01:43:34 (GMT)
commit291f55faf3e300871d0fb39032d2ab3921eedca2 (patch)
tree90e79c691fb6b74e6d982ce70cfa156657925fca /TurtleArt/tautils.py
parente61c4d18c0ee1fe45ba66990ecd28bb9b96ff39e (diff)
restrict dock to skin to journal
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r--TurtleArt/tautils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index 9798614..e251ccf 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -573,6 +573,16 @@ def dock_dx_dy(block1, dock1n, block2, dock2n):
(_b2x, _b2y) = block2.spr.get_xy()
return ((_b1x + _d1x) - (_b2x + _d2x), (_b1y + _d1y) - (_b2y + _d2y))
+def journal_check(blk1, blk2, dock1, dock2):
+ """ Dock blocks only if arg is Journal block """
+ if blk1 == None or blk2 == None:
+ return True
+ if (blk1.name == 'skin' and dock1 == 1) and blk2.name != 'journal':
+ return False
+ if (blk2.name == 'skin' and dock2 == 1) and blk1.name != 'journal':
+ return False
+ return True
+
def arithmetic_check(blk1, blk2, dock1, dock2):
""" Dock strings only if they convert to numbers. Avoid /0 and root(-1)"""
if blk1 == None or blk2 == None: