From f6198bd9019c85cc4ee16ae5a8e1d70ee8d4eb1a Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Tue, 02 Oct 2012 14:48:31 +0000 Subject: Use a similar surface to improve performance As the surface is created in draw callback, we need delay some operations until the surface is created. The undo keep is delayed until finish draw, then enable_undo() now only enable a flag, and a new method keep_undo() do the real task. This patch breaks rotation and mirror, will be adressed in another patch. Signed-off-by: Gonzalo Odiard --- (limited to 'Desenho.py') diff --git a/Desenho.py b/Desenho.py index 780fe07..1087819 100644 --- a/Desenho.py +++ b/Desenho.py @@ -743,7 +743,6 @@ class Desenho: else: self.points.append((widget.oldx, widget.oldy)) self.points.append((coords[0], coords[1])) - widget.enable_undo(overrite=True) widget.last = coords elif param == "release": if len(self.points) > 2: @@ -760,7 +759,7 @@ class Desenho: self._draw_polygon(widget, False, fill, self.points) widget.last = [] self.points = [] - widget.enable_undo(overrite=True) + widget.enable_undo() widget.queue_draw() return -- cgit v0.9.1