From 0f6128b71b5f0795b8032a1adefa592d0bc6694f Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sat, 22 May 2021 21:12:21 +0200 Subject: [PATCH] fix bug with selection --- src/svgcanvas/selection.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/svgcanvas/selection.js b/src/svgcanvas/selection.js index febc8c7e..e35c3a6a 100644 --- a/src/svgcanvas/selection.js +++ b/src/svgcanvas/selection.js @@ -155,16 +155,14 @@ export const getMouseTargetMethod = function (evt) { return selectionContext_.getSVGRoot(); } - const $target = mouseTarget; - // If it's a selection grip, return the grip parent - if (getClosest($target.parentNode, '#selectorParentGroup')) { + if (getClosest(mouseTarget.parentNode, '#selectorParentGroup')) { // While we could instead have just returned mouseTarget, // this makes it easier to indentify as being a selector grip return selectionContext_.getCanvas().selectorManager.selectorParentGroup; } - while (mouseTarget.parentNode !== (selectionContext_.getCurrentGroup() || currentLayer)) { + while (!mouseTarget.parentNode.isSameNode(selectionContext_.getCurrentGroup() || currentLayer)) { mouseTarget = mouseTarget.parentNode; }