Fixed delete selected shape error. (#858)

Co-authored-by: OZAN ALP (096023) <ozanalp@thy.com>
This commit is contained in:
Ozan-Alp 2022-04-15 17:45:42 +03:00 committed by GitHub
parent 784144aa29
commit 1a3313842c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)