From dc57156486a7cd415edf260387225c2474713232 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 29 May 2012 01:59:41 +0000 Subject: Undo fixed SL #3105 Remove the obsolete "redos" when the user clicks many times on "undo" and after that draws anything again. I mean, it's in the middle of the "undo" list and start drawing again. Signed-off-by: Manuel Kaufmann --- diff --git a/Area.py b/Area.py index 20fab69..2ff35cc 100644 --- a/Area.py +++ b/Area.py @@ -891,6 +891,11 @@ class Area(Gtk.DrawingArea): elif len(self._undo_list) == MAX_UNDO_STEPS: # drop the oldest undo pix: self._undo_list.pop(0) + + # it could be at the middle of the list (clicked many + # times undo) and after that draw anything, so we should + # discart the next redos because they are obsolete now. + self._undo_list = self._undo_list[:self._undo_index] else: self._undo_index += 1 # Forget the redos after this one: -- cgit v0.9.1