From adbd0235511caa9972ed2922e4d7f6bc956f46d2 Mon Sep 17 00:00:00 2001 From: DD Date: Fri, 22 Sep 2017 12:22:09 -0400 Subject: [PATCH] fix being able to select subgroups again --- src/helper/selection.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/helper/selection.js b/src/helper/selection.js index 607172e2..6d318f1d 100644 --- a/src/helper/selection.js +++ b/src/helper/selection.js @@ -366,7 +366,7 @@ const checkBoundsItem = function (selectionRect, item, event) { itemBounds.remove(); }; -const handleRectangularSelectionItems = function (item, event, rect, mode) { +const _handleRectangularSelectionItems = function (item, event, rect, mode, root) { if (isPathItem(item)) { let segmentMode = false; @@ -383,9 +383,9 @@ const handleRectangularSelectionItems = function (item, event, rect, mode) { segmentMode = true; } else { if (event.modifiers.shift && item.selected) { - setItemSelection(item, false); + setItemSelection(root, false); } else { - setItemSelection(item, true); + setItemSelection(root, true, true /* fullySelected */); } return false; } @@ -441,7 +441,7 @@ const _rectangularSelectionGroupLoop = function (group, rect, root, event, mode) if (isGroup(child) || isCompoundPathItem(child)) { _rectangularSelectionGroupLoop(child, rect, root, event, mode); } else { - handleRectangularSelectionItems(child, event, rect, mode); + _handleRectangularSelectionItems(child, event, rect, mode, root); } } return true; @@ -464,14 +464,10 @@ const processRectangularSelection = function (event, rect, mode) { continue; } if (isGroup(item) || isCompoundPathItem(item)) { - // Drill into the group in reshape mode; check for item segment points inside - if (mode === Modes.RESHAPE) { - _rectangularSelectionGroupLoop(item, rect, item, event, mode); - } else { - setGroupSelection(item, true, true /* fullySelected */); - } + // check for item segment points inside + _rectangularSelectionGroupLoop(item, rect, item, event, mode); } else { - handleRectangularSelectionItems(item, event, rect, mode); + _handleRectangularSelectionItems(item, event, rect, mode, item); } } };