From 4b34d147fd8512e85d2331eb70642a82db635ec8 Mon Sep 17 00:00:00 2001
Message-Id: <4b34d147fd8512e85d2331eb70642a82db635ec8.1338256789.git.humitos@gmail.com>
From: Manuel Kaufmann <humitos@gmail.com>
Date: Mon, 28 May 2012 22:59:41 -0300
Subject: [PATCH Paint] 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 <humitos@gmail.com>
---
Area.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Area.py b/Area.py
index b889974..fa841df 100644
a
|
b
|
class Area(gtk.DrawingArea): |
857 | 857 | elif len(self._undo_list) == MAX_UNDO_STEPS: |
858 | 858 | # drop the oldest undo pix: |
859 | 859 | self._undo_list.pop(0) |
| 860 | |
| 861 | # it could be at the middle of the list (clicked many |
| 862 | # times undo) and after that draw anything, so we should |
| 863 | # discart the next redos because they are obsolete now. |
| 864 | self._undo_list = self._undo_list[:self._undo_index] |
860 | 865 | else: |
861 | 866 | self._undo_index += 1 |
862 | 867 | # Forget the redos after this one: |