diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2013-01-11 14:09:16 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2013-01-11 14:09:16 (GMT) |
commit | 85aac4be684f1233d534ab10f19dc48d57a3b88d (patch) | |
tree | 8b7e53b13522137bd571997e5676edaa141a42e1 /Area.py | |
parent | 943f36e4ddeb47e7ea63647d2a4d793a7ccf5bc4 (diff) |
Avoid execute tool_end before the last tool_move - OLPC #12405
We are using a timeout in the mousemove events to avoid flood
with more events than the application can draw, but this can produce
get a move event after the method to finish the draw was executed.
As they draw in different canvas, the last part of the draw is lost.
This patch add a timeout a little bigger to the toolend call,
to avoid this situation.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'Area.py')
-rw-r--r-- | Area.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -432,7 +432,7 @@ class Area(Gtk.DrawingArea): else: self._on_touch = False shift_pressed = False - self.tool_end(x, y, shift_pressed) + GObject.timeout_add(10, self.tool_end, x, y, shift_pressed) def tool_start(self, coord_x, coord_y, button1_pressed): width, height = self.get_size() @@ -670,7 +670,7 @@ class Area(Gtk.DrawingArea): else: if self.tool['name'] in ['brush', 'eraser', 'rainbow', 'pencil', 'stamp']: - # define area to update + # define area to update (only to show the brush shape) last_coords = (self.last_x_cursor, self.last_y_cursor) area = self.calculate_damaged_area([last_coords, coords]) self.queue_draw_area(*area) |