Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-09-19 23:01:19 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-09-19 23:01:19 (GMT)
commit920ad48dbea89b4801259aac10e58efd9692038c (patch)
tree61f5284413ee66372d1366e054189448f990c9bc /TurtleArt/tawindow.py
parent3153d90a7a2cd98f24d7a35cde5cd1f8183f4825 (diff)
autoexpand blocks when docking (#2336)
Diffstat (limited to 'TurtleArt/tawindow.py')
-rw-r--r--TurtleArt/tawindow.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 3100d7c..98b8e16 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1568,6 +1568,29 @@ class TurtleArtWindow():
if my_block.connections is not None:
my_block.connections[best_my_dockn] = best_you
+ if best_you.name not in BOOLEAN_STYLE and \
+ best_you.name in EXPANDABLE_BLOCKS and best_your_dockn == 1:
+ if my_block.name in EXPANDABLE_BLOCKS:
+ dy = 20 + my_block.ey - best_you.ey
+ if dy != 0:
+ best_you.expand_in_y(dy)
+ group = find_group(my_block)
+ group.append(best_you)
+ for gblk in find_group(best_you):
+ if gblk not in group:
+ gblk.spr.move_relative((0, dy * best_you.scale))
+ if best_you.name in COMPARE_STYLE:
+ for gblk in find_group(best_you):
+ gblk.spr.move_relative((0,
+ -dy * best_you.scale))
+ else:
+ if best_you.ey > 0:
+ dy = best_you.reset_y()
+ if best_you.name in COMPARE_STYLE:
+ for gblk in find_group(best_you):
+ gblk.spr.move_relative((0,
+ -dy * best_you.scale))
+
def _import_from_journal(self, blk):
""" Import a file from the Sugar Journal """
if self.running_sugar: