From 1a3313842cbfb650fa518ac42e7599d4ce24fdfd Mon Sep 17 00:00:00 2001 From: Ozan-Alp <53511744+Ozan-Alp@users.noreply.github.com> Date: Fri, 15 Apr 2022 17:45:42 +0300 Subject: [PATCH] Fixed delete selected shape error. (#858) Co-authored-by: OZAN ALP (096023) --- labelImg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/labelImg.py b/labelImg.py index d7401bca..2cac92a5 100755 --- a/labelImg.py +++ b/labelImg.py @@ -1054,7 +1054,10 @@ class MainWindow(QMainWindow, WindowMixin): self.canvas.setEnabled(False) if file_path is None: file_path = self.settings.get(SETTING_FILENAME) - + #Deselect shape when loading new file + if self.canvas.selected_shape: + self.canvas.selected_shape.selected = False + self.canvas.selected_shape = None # Make sure that filePath is a regular python string, rather than QString file_path = ustr(file_path)