From d69a087eb78fbb106e28e4ddc83c469f28ca205c Mon Sep 17 00:00:00 2001 From: LuGu <2623587501@qq.com> Date: Tue, 7 Dec 2021 21:52:58 +0800 Subject: [PATCH] Modify the bug --- PPOCRLabel/libs/canvas.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PPOCRLabel/libs/canvas.py b/PPOCRLabel/libs/canvas.py index d5662ac79..6ac1f28b8 100644 --- a/PPOCRLabel/libs/canvas.py +++ b/PPOCRLabel/libs/canvas.py @@ -704,8 +704,9 @@ class Canvas(QWidget): def keyPressEvent(self, ev): key = ev.key() - shapesBackup = [] shapesBackup = copy.deepcopy(self.shapes) + if len(shapesBackup) == 0: + return self.shapesBackups.pop() self.shapesBackups.append(shapesBackup) if key == Qt.Key_Escape and self.current: