Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tacollaboration.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/tacollaboration.py')
-rw-r--r--TurtleArt/tacollaboration.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/TurtleArt/tacollaboration.py b/TurtleArt/tacollaboration.py
index 26a21d7..d0a41a3 100644
--- a/TurtleArt/tacollaboration.py
+++ b/TurtleArt/tacollaboration.py
@@ -1,4 +1,4 @@
-#Copyright (c) 2011-12 Walter Bender
+#Copyright (c) 2011-13 Walter Bender
#Copyright (c) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
#Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -75,7 +75,7 @@ class Collaboration():
'f': self._move_forward,
'a': self._move_in_arc,
'r': self._rotate_turtle,
- 'x': self._setxy,
+ 'x': self._set_xy,
'W': self._draw_text,
'c': self._set_pen_color,
'g': self._set_pen_gray_level,
@@ -347,12 +347,12 @@ class Collaboration():
self._tw.turtles.set_turtle(nick)
self._tw.turtles.get_active_turtle().set_heading(h, False)
- def _setxy(self, payload):
+ def _set_xy(self, payload):
if len(payload) > 0:
[nick, [x, y]] = data_from_string(payload)
if nick != self._tw.nick:
self._tw.turtles.set_turtle(nick)
- self._tw.turtles.get_active_turtle().set_xy(x, y, False)
+ self._tw.turtles.get_active_turtle().set_xy(x, y, share=False)
def _draw_text(self, payload):
if len(payload) > 0:
@@ -401,9 +401,14 @@ class Collaboration():
[nick, poly_points] = data_from_string(payload)
shared_poly_points = []
for i in range(len(poly_points)):
- shared_poly_points.append(
- (self._tw.turtles.turtle_to_screen_coordinates
- (poly_points[i][0], poly_points[i][1])))
+ x, y = self._turtles.screen_to_turtle_coordinates(
+ (poly_points[i][1], poly_points[i][2]))
+ if poly_points[i][0] in ['move', 'line']:
+ shared_poly_points.append((poly_points[i][0], x, y))
+ elif poly_points[i][0] in ['rarc', 'larc']:
+ shared_poly_points.append((poly_points[i][0], x, y,
+ poly_points[i][3], poly_points[i][4],
+ poly_points[i][5]))
if nick != self._tw.nick:
self._tw.turtles.set_turtle(nick)
self._tw.turtles.get_active_turtle().set_poly_points(