From a5945db3c49be7befb428bc46c578f3a8de1b8d1 Mon Sep 17 00:00:00 2001 From: agriyadev5 Date: Thu, 22 Jul 2021 12:06:26 +0530 Subject: [PATCH] #262 Shape selection not working as expected with the rectangle / circle tool active --- src/svgcanvas/event.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/svgcanvas/event.js b/src/svgcanvas/event.js index b50fb5bd..ee29f0a9 100644 --- a/src/svgcanvas/event.js +++ b/src/svgcanvas/event.js @@ -877,7 +877,10 @@ export const mouseUpEvent = function (evt) { if (eventContext_.getCurrentMode() === 'path') { svgCanvas.pathActions.toEditMode(element); } else if (eventContext_.getCurConfig().selectNew) { - svgCanvas.setMode('select'); + const modes = [ 'circle', 'ellipse', 'square', 'rect', 'fhpath', 'line', 'fhellipse', 'fhrect', 'star', 'polygon' ]; + if ( modes.indexOf(eventContext_.getCurrentMode()) !== -1) { + svgCanvas.setMode('select'); + } svgCanvas.selectOnly([ element ], true); } // we create the insert command that is stored on the stack