From 85aac4be684f1233d534ab10f19dc48d57a3b88d Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Fri, 11 Jan 2013 14:09:16 +0000 Subject: 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 --- (limited to 'Area.py') diff --git a/Area.py b/Area.py index 5661def..271cb5f 100644 --- a/Area.py +++ b/Area.py @@ -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) -- cgit v0.9.1