From 0be98e542315673bc4ddc35b52eea35b20522c66 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 05 Jul 2012 20:11:35 +0000 Subject: resize clamps on project load --- 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) -- cgit v0.9.1