Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Desenho.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-07-24 20:56:10 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-08-10 13:49:30 (GMT)
commit5e21c46db8801459a91621e518640b53a7224dbf (patch)
tree329cdaf1e0bd0ab9e8a3e180f1ea98343ac973d8 /Desenho.py
parent1a0de2965f7a9c3b147b6b08054f648cd4bc3614 (diff)
Implement undo/redo using cairo
The stored images are pixbuf instead of pixmaps now. Created two methods _surface_to_pixbuf and _pixbuf_to_context to copy from/to pixtuf/surfaces because the code was used in a few places. enableUndo was renamed to enable_undo too and unneded parameters removed. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'Desenho.py')
-rw-r--r--Desenho.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Desenho.py b/Desenho.py
index 7917a55..c67c532 100644
--- a/Desenho.py
+++ b/Desenho.py
@@ -580,7 +580,7 @@ class Desenho:
except AttributeError:
buf.set_text('')
- widget.enableUndo(widget)
+ widget.enable_undo()
widget.queue_draw()
@@ -745,7 +745,7 @@ class Desenho:
else:
self.points.append((widget.oldx, widget.oldy))
self.points.append((coords[0], coords[1]))
- widget.enableUndo(widget, overrite=True)
+ widget.enable_undo(overrite=True)
widget.last = coords
elif param == "release":
if len(self.points) > 2:
@@ -762,7 +762,7 @@ class Desenho:
self._draw_polygon(widget, False, fill, self.points)
widget.last = []
self.points = []
- widget.enableUndo(widget, overrite=True)
+ widget.enable_undo(overrite=True)
widget.queue_draw()
return