diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-10-02 14:48:31 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-10-02 20:52:49 (GMT) |
commit | f6198bd9019c85cc4ee16ae5a8e1d70ee8d4eb1a (patch) | |
tree | 471a3e6b8533ac7ba966188ddb8a1739f01e8be1 /Desenho.py | |
parent | 1df3e8f52bc19af58daac4a0e8e81b2c1469de22 (diff) |
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 <gonzalo@laptop.org>
Diffstat (limited to 'Desenho.py')
-rw-r--r-- | Desenho.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 |