Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/tawindow.py')
-rw-r--r--TurtleArt/tawindow.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 97c70f3..d187580 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -2245,7 +2245,9 @@ class TurtleArtWindow():
elif blk.name == 'identity2' or blk.name == 'hspace':
group = find_group(blk)
if hide_button_hit(blk.spr, x, y):
- dx = blk.reset_x()
+ dx = -20
+ blk.contract_in_x(-dx)
+ # dx = blk.reset_x()
elif show_button_hit(blk.spr, x, y):
dx = 20
blk.expand_in_x(dx)
@@ -2259,7 +2261,9 @@ class TurtleArtWindow():
elif blk.name == 'vspace':
group = find_group(blk)
if hide_button_hit(blk.spr, x, y):
- dy = blk.reset_y()
+ dy = -20
+ blk.contract_in_y(-dy)
+ # dy = blk.reset_y()
elif show_button_hit(blk.spr, x, y):
dy = 20
blk.expand_in_y(dy)
@@ -2278,7 +2282,9 @@ class TurtleArtWindow():
dock0 = blk0.connections.index(blk)
if hide_button_hit(blk.spr, x, y):
- dy = blk.reset_y()
+ dy = -20
+ blk.contract_in_y(-dy)
+ # dy = blk.reset_y()
elif show_button_hit(blk.spr, x, y):
dy = 20
blk.expand_in_y(dy)
@@ -3340,6 +3346,14 @@ class TurtleArtWindow():
b[3] + self.canvas.cy + offset,
'block', values, self.block_scale)
+ # If it was an unknown block type, we need to match the number
+ # of dock items. TODO: Try to infer the dock type from connections
+ if len(b[4]) > len(blk.docks):
+ debug_output('dock mismatch %d > %d' % (len(b[4]), len(blk.docks)),
+ self.running_sugar)
+ for i in range(len(b[4]) - len(blk.docks)):
+ blk.docks.append(['unavailable', True, 0, 0])
+
# Some blocks get transformed.
if btype in block_styles['basic-style-var-arg'] and value is not None:
# Is there code stored in this userdefined block?