From e742fa14e47accc4428201d6f654ffc19cb4c0ae Mon Sep 17 00:00:00 2001 From: Hironsan Date: Sun, 10 Jul 2022 17:30:46 +0900 Subject: [PATCH] Unselect the region on clicking outside of the region --- frontend/components/tasks/boundingBox/VBoundingBox.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/components/tasks/boundingBox/VBoundingBox.vue b/frontend/components/tasks/boundingBox/VBoundingBox.vue index b46a7da7..351be293 100644 --- a/frontend/components/tasks/boundingBox/VBoundingBox.vue +++ b/frontend/components/tasks/boundingBox/VBoundingBox.vue @@ -179,8 +179,12 @@ export default Vue.extend({ onMouseDown(e: Konva.KonvaEventObject) { if (e.target instanceof Konva.Image) { // while new polygon is creating, prevent to select polygon. + const clickedOutsideOfRectangle = !!this.selectedRectangle this.selectedRectangle = null this.updateTransformer() + if (clickedOutsideOfRectangle) { + return + } } // prevent multiple event. if (e.target instanceof HTMLCanvasElement) {