Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/taproject.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-01-31 14:17:38 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-01-31 14:17:38 (GMT)
commitff29472f9d09be4b05412d45a5e7c85e71af07b9 (patch)
tree2b1e3410eaed470e4d2054459dd85e1bfca6dc3b /taproject.py
parent6b72c189408a631a305b20acfff2192ae9d858de (diff)
save/restore expandable block sizes
Diffstat (limited to 'taproject.py')
-rw-r--r--taproject.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/taproject.py b/taproject.py
index 9f33bf3..b72f154 100644
--- a/taproject.py
+++ b/taproject.py
@@ -190,6 +190,11 @@ def load_block(tw, b):
else:
blk.spr.set_image(tw.media_shapes['pythonoff'], 1, 17, 8)
blk.spr.set_label(' ')
+ elif btype in EXPANDABLE:
+ if btype == 'vspace':
+ blk.expand_in_y(value)
+ elif btype == 'hspace':
+ blk.expand_in_x(value)
elif btype in BOX_STYLE_MEDIA and blk.values[0] is not None:
if btype == 'audio' or btype == 'description':
blk.spr.set_image(tw.media_shapes[btype+'on'], 1, 37, 6)
@@ -288,6 +293,14 @@ def _assemble_data_to_save(tw, save_turtle=True):
for b in tw._just_blocks():
if b.name in CONTENT_BLOCKS:
name = (b.name, b.values[0])
+ elif b.name in EXPANDABLE:
+ ex, ey = b.get_expand_x_y()
+ if ex > 0:
+ name = (b.name, ex)
+ elif ey > 0:
+ name = (b.name, ey)
+ else:
+ name = (b.name, 0)
else:
name = (b.name)
if hasattr(b, 'connections'):