From 59c8956819a2ce1357ab179072315cec759349a7 Mon Sep 17 00:00:00 2001 From: cvhub Date: Thu, 21 Mar 2024 11:22:57 +0800 Subject: [PATCH] Add: Refine canvas reset behavior to prevent unintended blank canvas state (#321) --- anylabeling/views/labeling/label_widget.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/anylabeling/views/labeling/label_widget.py b/anylabeling/views/labeling/label_widget.py index e8053279..ed5dbb98 100644 --- a/anylabeling/views/labeling/label_widget.py +++ b/anylabeling/views/labeling/label_widget.py @@ -4282,7 +4282,11 @@ def delete_file(self): item = self.file_list_widget.currentItem() item.setCheckState(Qt.Unchecked) + filename = self.filename self.reset_state() + self.filename = filename + if self.filename: + self.load_file(self.filename) def delete_image_file(self): if len(self.image_list) <= 0: