Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/tacanvas.py2
-rw-r--r--TurtleArt/tawindow.py14
2 files changed, 10 insertions, 6 deletions
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index 4b8e974..e1e229e 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -689,7 +689,7 @@ class TurtleGraphics:
(self.cx + x - self.tw.active_turtle.spr.rect.width / 2.,
self.cy + y - self.tw.active_turtle.spr.rect.height / 2.))
else:
- self.tw.active_turtle.move(self.cx + x, self.cy + y)
+ self.tw.active_turtle.move((self.cx + x, self.cy + y))
def get_color_index(self, r, g, b, a=0):
''' Find the closest palette entry to the rgb triplet '''
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 078ef55..4e93e9b 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -98,6 +98,7 @@ class TurtleArtWindow():
self.send_event = None # method to send events over the network
self.gst_available = GST_AVAILABLE
self.running_sugar = False
+ self.nick = None
if type(canvas_window) == gtk.DrawingArea:
self.interactive_mode = True
self.window = canvas_window
@@ -108,8 +109,6 @@ class TurtleArtWindow():
self.running_sugar = True
from sugar import profile
self.nick = profile.get_nick_name()
- else:
- self.nick = None
self._setup_events()
else:
self.interactive_mode = False
@@ -1916,7 +1915,8 @@ class TurtleArtWindow():
newblk = self.load_block(blk, offset)
if newblk is not None:
blocks.append(newblk)
- newblk.spr.set_layer(TOP_LAYER)
+ if newblk.spr is not None:
+ newblk.spr.set_layer(TOP_LAYER)
else:
blocks.append(None)
# Some extra blocks may have been added by load_block
@@ -1925,7 +1925,8 @@ class TurtleArtWindow():
newblk = self.load_block(blk, offset)
if newblk is not None:
blocks.append(newblk)
- newblk.spr.set_layer(TOP_LAYER)
+ if newblk.spr is not None:
+ newblk.spr.set_layer(TOP_LAYER)
# Make the connections.
for i, blk in enumerate(blocks):
@@ -2030,7 +2031,8 @@ class TurtleArtWindow():
blocks = blocks_copy[:]
# Resize blocks to current scale
- self.resize_blocks(blocks)
+ if self.interactive_mode:
+ self.resize_blocks(blocks)
if len(blocks) > 0:
return blocks[0]
@@ -2914,6 +2916,8 @@ class TurtleArtWindow():
def _resize_clamp(self, blk, gblk, dockn=-2):
''' If the content of a clamp changes, resize it '''
+ if not self.interactive_mode:
+ return
if dockn < 0:
dockn = len(blk.docks) + dockn
y1 = blk.docks[-1][3]