When switching active tool after drawing an unclosed selection, the selection should be reset

This commit is contained in:
Igor Zinken
2021-01-20 09:59:51 +01:00
parent f04188f6cd
commit 52e9a078c9
2 changed files with 9 additions and 1 deletions

View File

@@ -201,7 +201,7 @@ export default {
this.updateInteractionPane();
} else {
this.handleCursor();
getCanvasInstance()?.interactionPane.setInteractive( false );
getCanvasInstance()?.interactionPane?.handleActiveTool( tool, false );
}
},
zoomOptions: {

View File

@@ -94,6 +94,14 @@ class InteractionPane extends sprite {
}
}
handleActiveTool( tool, remainInteractive ) {
if ( tool !== ToolTypes.LASSO && this.document?.selection && !this._selectionClosed ) {
// reset unclosed selection when switching tools
this.resetSelection();
}
this.setInteractive( remainInteractive );
}
stayOnTop() {
if ( !this._enabled ) {
return;