Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tawindow.py b/tawindow.py
index 186896b..7b2edee 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -1489,7 +1489,8 @@ class TurtleArtWindow():
best_your_dockn = your_dockn
best_my_dockn = my_dockn
if d<200:
- if self._arithmetic_check(my_block, best_you) is False:
+ if self._arithmetic_check(my_block, best_you, best_my_dockn,
+ best_your_dockn) is False:
return
for blk in self.drag_group:
(sx, sy) = blk.spr.get_xy()
@@ -1505,7 +1506,7 @@ class TurtleArtWindow():
"""
Additional docking check for arithmetic blocks
"""
- def _arithmetic_check(self, b1, b2):
+ def _arithmetic_check(self, b1, b2, d1, d2):
if b1 == None or b2 == None:
return True
if b1.name in ['sqrt', 'number'] and b2.name in ['sqrt', 'number']:
@@ -1515,9 +1516,9 @@ class TurtleArtWindow():
return False
elif b1.name in ['division2', 'number'] and\
b2.name in ['division2', 'number']:
- if b1.name == 'number' and float(b1.values[0]) == 0:
+ if b1.name == 'number' and float(b1.values[0]) == 0 and d2 == 2:
return False
- elif b2.name == 'number' and float(b2.values[0]) == 0:
+ elif b2.name == 'number' and float(b2.values[0]) == 0 and d1 == 2:
return False
elif b1.name in ['product2', 'minus2', 'sqrt', 'division2', 'random',
'remainder2', 'string'] and\