Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tacollaboration.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-02-10 21:21:15 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-02-10 21:21:15 (GMT)
commit81adaceebc67c605c1576c0b2070f2ec543ef4e7 (patch)
treef83173db56d3a8db1b88c8fe6ace8a0e56cd21d0 /TurtleArt/tacollaboration.py
parent3f35b22e3f616e6a9b31b5d49945f8881bb66017 (diff)
cleaned up fill_polygon sharing
Diffstat (limited to 'TurtleArt/tacollaboration.py')
-rw-r--r--TurtleArt/tacollaboration.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/TurtleArt/tacollaboration.py b/TurtleArt/tacollaboration.py
index e2e7662..ed29675 100644
--- a/TurtleArt/tacollaboration.py
+++ b/TurtleArt/tacollaboration.py
@@ -186,6 +186,8 @@ class Collaboration():
save_active_turtle = self._tw.active_turtle
command, payload = event_message.split("|", 2)
+ print "event message %s" % command
+ _logger.debug("event message (%s)" % command)
self._processing_methods[command](payload)
# Restore active Turtle
@@ -226,6 +228,8 @@ class Collaboration():
def _draw_pixbuf(self, payload):
if len(payload) > 0:
+ print "trying to draw a shared pixbuf"
+ _logger.debug("(trying to draw a shared pixbuf)")
[nick, [a, b, x, y, w, h, width, height, data]] =\
data_from_string(payload)
if nick != self._tw.nick:
@@ -233,7 +237,9 @@ class Collaboration():
tmp_path = get_path(self.tw.activity, 'instance')
else:
tmp_path = '/tmp'
+ print "creating %s" % (tmp_path)
file_name = base64_to_image(data, tmp_path)
+ print "opening %s" % (file_path)
pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(file_name,
width, height)
self._tw.canvas.draw_pixbuf(pixbuf, a, b, x, y, w, h,
@@ -311,8 +317,13 @@ class Collaboration():
def _fill_polygon(self, payload):
# Check to make sure that the poly_point array is passed properly
if len(payload) > 0:
- [nick, minx, miny, w, h, poly_points] = data_from_string(payload)
- self._tw.canvas.fill_polygon(poly_points, minx, miny, w, h)
+ [nick, poly_points] = data_from_string(payload)
+ shared_poly_points = []
+ for i in range(len(poly_points)):
+ shared_poly_points.append((
+ self._tw.canvas.turtle_to_screen_coordinates(
+ poly_points[i][0], poly_points[i][1])))
+ self._tw.canvas.fill_polygon(shared_poly_points)
def _get_dictionary(self):
d = {self._get_nick(): self._get_colors()}
@@ -330,7 +341,6 @@ class Collaboration():
colors = self._activity.get_colors()
if colors is None:
colors = '#008000,#00A000'
- _logger.debug(colors)
return colors