From 9002afed1fe60f98c44f6a2ea6a25ba8377cc453 Mon Sep 17 00:00:00 2001 From: Anthony Tan Date: Mon, 29 May 2023 12:14:14 -0400 Subject: [PATCH] change so that when user clicks after making a select box, the box is removed instead of a tiny one replacing it --- source/pixel.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/pixel.js b/source/pixel.js index 61496c06..2c723e86 100644 --- a/source/pixel.js +++ b/source/pixel.js @@ -665,6 +665,16 @@ export default class PixelPlugin case this.tools.type.grab: mouseClickDiv.style.cursor = "-webkit-grab"; break; + case this.tools.type.select: + if(this.selection !== null && this.selection.selectedShape !== null) { + let rectangle = this.selection.selectedShape; + //if the rectangle has 0 area, then the user just clicked and should be + //interpreted as a command to remove the current selection + if(rectangle.relativeRectHeight === 0 && rectangle.relativeRectWidth === 0) { + this.selection.clearSelection(this.core.getSettings().maxZoomLevel); + } + } + break; default: } }