Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-04 23:05:18 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-04 23:05:18 (GMT)
commit5ce3abf5e64a2ce3a58b08ef1b7b2dcd9ce6f401 (patch)
treee0152eb5458cc86268cc8e5401381250fb65facd /tawindow.py
parentbb1e354c5aefba6c1cfc323290296f2265ba877a (diff)
cleaned up copy/paste
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tawindow.py b/tawindow.py
index 5a4afa3..4fe61aa 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -1802,12 +1802,17 @@ class TurtleArtWindow():
Pack the project (or stack) into a data stream to be serialized
"""
def assemble_data_to_save(self, save_turtle=True, save_project=True):
- # TODO: if save_project is False: just the current stack
data = []
+ blks = []
+
+ if save_project is True:
+ blks = self.just_blocks()
+ else:
+ blks = self._find_group(self.find_top_block(self.selected_blk))
- for i, b in enumerate(self.just_blocks()):
+ for i, b in enumerate(blks):
b.id = i
- for b in self.just_blocks():
+ for b in blks:
if b.name in CONTENT_BLOCKS:
if len(b.values)>0:
name = (b.name, b.values[0])
@@ -1829,6 +1834,10 @@ class TurtleArtWindow():
else:
connections = None
(sx, sy) = b.spr.get_xy()
+ # Add a slight offset for copy/paste
+ if save_project is False:
+ sx+=20
+ sy+=20
data.append((b.id, name, sx-self.canvas.cx, sy-self.canvas.cy,
connections))
if save_turtle is True: