Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
path: root/Area.py
diff options
authorGonzalo Odiard <godiard@gmail.com>2013-01-11 14:09:16 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-01-11 14:09:16 (GMT)
commit85aac4be684f1233d534ab10f19dc48d57a3b88d (patch)
tree8b7e53b13522137bd571997e5676edaa141a42e1 /Area.py
parent943f36e4ddeb47e7ea63647d2a4d793a7ccf5bc4 (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')
1 files changed, 2 insertions, 2 deletions
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):
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):
if self.tool['name'] in ['brush', 'eraser', 'rainbow', 'pencil',
- # 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])