fix being able to select subgroups again

This commit is contained in:
DD 2017-09-22 12:22:09 -04:00
parent fd9a4af83f
commit 05ad64fd01

View file

@ -366,7 +366,7 @@ const checkBoundsItem = function (selectionRect, item, event) {
itemBounds.remove(); itemBounds.remove();
}; };
const handleRectangularSelectionItems = function (item, event, rect, mode) { const _handleRectangularSelectionItems = function (item, event, rect, mode, root) {
if (isPathItem(item)) { if (isPathItem(item)) {
let segmentMode = false; let segmentMode = false;
@ -383,9 +383,9 @@ const handleRectangularSelectionItems = function (item, event, rect, mode) {
segmentMode = true; segmentMode = true;
} else { } else {
if (event.modifiers.shift && item.selected) { if (event.modifiers.shift && item.selected) {
setItemSelection(item, false); setItemSelection(root, false);
} else { } else {
setItemSelection(item, true); setItemSelection(root, true, true /* fullySelected */);
} }
return false; return false;
} }
@ -441,7 +441,7 @@ const _rectangularSelectionGroupLoop = function (group, rect, root, event, mode)
if (isGroup(child) || isCompoundPathItem(child)) { if (isGroup(child) || isCompoundPathItem(child)) {
_rectangularSelectionGroupLoop(child, rect, root, event, mode); _rectangularSelectionGroupLoop(child, rect, root, event, mode);
} else { } else {
handleRectangularSelectionItems(child, event, rect, mode); _handleRectangularSelectionItems(child, event, rect, mode, root);
} }
} }
return true; return true;
@ -464,14 +464,10 @@ const processRectangularSelection = function (event, rect, mode) {
continue; continue;
} }
if (isGroup(item) || isCompoundPathItem(item)) { if (isGroup(item) || isCompoundPathItem(item)) {
// Drill into the group in reshape mode; check for item segment points inside // check for item segment points inside
if (mode === Modes.RESHAPE) {
_rectangularSelectionGroupLoop(item, rect, item, event, mode); _rectangularSelectionGroupLoop(item, rect, item, event, mode);
} else { } else {
setGroupSelection(item, true, true /* fullySelected */); _handleRectangularSelectionItems(item, event, rect, mode, item);
}
} else {
handleRectangularSelectionItems(item, event, rect, mode);
} }
} }
}; };