From f5e3c36436e974b3b0de7f9810472d719fcf12e1 Mon Sep 17 00:00:00 2001
Message-Id: <f5e3c36436e974b3b0de7f9810472d719fcf12e1.1338589740.git.humitos@gmail.com>
From: Manuel Kaufmann <humitos@gmail.com>
Date: Fri, 1 Jun 2012 19:27:28 -0300
Subject: [PATCH Paint] Undo after using bucket tool fixed SL #3105
Fixed the ability to go back and forward through the undo list after using many
times the bucket tool.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
---
Area.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Area.py b/Area.py
index d8997a1..a81cda3 100644
a
|
b
|
class Area(gtk.DrawingArea): |
663 | 663 | widget.queue_draw() |
664 | 664 | self.drawing = False |
665 | 665 | self.desenha = False |
666 | | if not private_undo: |
| 666 | if not private_undo and self.tool['name'] != 'bucket': |
| 667 | # We have to avoid saving an undo state if the bucket tool |
| 668 | # is selected because this undo state is called before the |
| 669 | # gobject.idle_add (with the fill_flood function) finishes |
| 670 | # and an unconsistent undo state is saved |
667 | 671 | self.enableUndo(widget) |
668 | 672 | |
669 | 673 | def fast_flood_fill(self, widget, x, y, width, height): |
670 | 674 | fill(self.pixmap, self.gc, x, y, width, |
671 | 675 | height, self.gc_line.foreground.pixel) |
672 | 676 | widget.queue_draw() |
| 677 | self.enableUndo(widget) |
673 | 678 | display = gtk.gdk.display_get_default() |
674 | 679 | cursor = gtk.gdk.cursor_new_from_name(display, 'paint-bucket') |
675 | 680 | self.window.set_cursor(cursor) |
… |
… |
class Area(gtk.DrawingArea): |
709 | 714 | |
710 | 715 | self.pixmap.draw_image(self.gc, gdk_image, 0, 0, 0, 0, width, height) |
711 | 716 | self.queue_draw() |
| 717 | self.enableUndo(self) |
712 | 718 | |
713 | 719 | display = gtk.gdk.display_get_default() |
714 | 720 | cursor = gtk.gdk.cursor_new_from_name(display, 'paint-bucket') |