Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-07-05 20:11:35 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-07-05 20:11:35 (GMT)
commit0be98e542315673bc4ddc35b52eea35b20522c66 (patch)
tree526563b9924146dc17cfcee2be58a54d51ad9e94
parent6c56adbc990b82b25256805cf683ef0dde5b28b8 (diff)
resize clamps on project load
-rw-r--r--TurtleArt/tawindow.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 31e8f6a..c325af8 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -1791,7 +1791,6 @@ class TurtleArtWindow():
def process_data(self, block_data, offset=0):
''' Process block_data (from a macro, a file, or the clipboard). '''
-
self._process_block_data = []
for blk in block_data:
if not self._found_a_turtle(blk):
@@ -1887,6 +1886,23 @@ class TurtleArtWindow():
blk.refresh()
grow_stack_arm(find_sandwich_top(blk))
+ # process in reverse order
+ for i in range(len(blocks)):
+ blk = blocks[-i - 1]
+ if blk.name in EXPANDABLE_FLOW:
+ if blk.name in block_styles['clamp-style-1arg'] or\
+ blk.name in block_styles['clamp-style-boolean']:
+ if blk.connections[2] is not None:
+ self._resize_clamp(blk, blk.connections[2])
+ elif blk.name in block_styles['clamp-style']:
+ if blk.connections[1] is not None:
+ self._resize_clamp(blk, blk.connections[1])
+ elif blk.name in block_styles['clamp-style-else']:
+ if blk.connections[2] is not None:
+ self._resize_clamp(blk, blk.connections[2], dockn=2)
+ if blk.connections[3] is not None:
+ self._resize_clamp(blk, blk.connections[3], dockn=3)
+
# Resize blocks to current scale
self.resize_blocks(blocks)