diff options
Diffstat (limited to 'drawing.py')
-rw-r--r-- | drawing.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -94,10 +94,10 @@ class Drawing(gtk.DrawingArea): height = self._drawing_canvas.get_height() return width, height - def remote_stroke(self, stroke_points): + def remote_stroke(self, stroke_points, settings): """Draw stroke from other player.""" context = cairo.Context(self._drawing_canvas) - self._set_stroke_context(context) + self._set_stroke_context(context, settings) self._paint_stroke(context, stroke_points) self.queue_draw() @@ -126,10 +126,12 @@ class Drawing(gtk.DrawingArea): if self.we_are_sharing: self._parent.send_new_drawing() - def _set_stroke_context(self, context): + def _set_stroke_context(self, context, settings=None): """Set the settings of our brush to the Cairo context.""" - context.set_source_rgba(*self._settings['stroke color']) - context.set_line_width(self._settings['stroke width']) + if settings is None: + settings = self._settings + context.set_source_rgba(*settings['stroke color']) + context.set_line_width(settings['stroke width']) def _paint_stroke(self, context, stroke_points): """Draw lines from the list of points to the Cairo context""" @@ -154,7 +156,7 @@ class Drawing(gtk.DrawingArea): self._paint_stroke(context, self._stroke_points) if self.we_are_sharing: - self._parent.send_stroke(self._stroke_points) + self._parent.send_stroke(self._stroke_points, self._settings) # Clean the list of points: if continue_stroke: |