mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: box select frame & children to allow resizing at the same time (#9031)
* box select frame & children * avoid selecting children twice to avoid double their moving * do not show ele stats if frame and children selected together * do not update frame membership if selected together * do not group frame and its children * comment and refactor code * hide align altogether * include frame children when selecting all * simplify --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
7028daa44a
commit
52eaf64591
12 changed files with 122 additions and 44 deletions
|
@ -183,10 +183,12 @@ export const getSelectedElements = (
|
|||
includeElementsInFrames?: boolean;
|
||||
},
|
||||
) => {
|
||||
const addedElements = new Set<ExcalidrawElement["id"]>();
|
||||
const selectedElements: ExcalidrawElement[] = [];
|
||||
for (const element of elements.values()) {
|
||||
if (appState.selectedElementIds[element.id]) {
|
||||
selectedElements.push(element);
|
||||
addedElements.add(element.id);
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
|
@ -195,6 +197,7 @@ export const getSelectedElements = (
|
|||
appState.selectedElementIds[element?.containerId]
|
||||
) {
|
||||
selectedElements.push(element);
|
||||
addedElements.add(element.id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -203,8 +206,8 @@ export const getSelectedElements = (
|
|||
const elementsToInclude: ExcalidrawElement[] = [];
|
||||
selectedElements.forEach((element) => {
|
||||
if (isFrameLikeElement(element)) {
|
||||
getFrameChildren(elements, element.id).forEach((e) =>
|
||||
elementsToInclude.push(e),
|
||||
getFrameChildren(elements, element.id).forEach(
|
||||
(e) => !addedElements.has(e.id) && elementsToInclude.push(e),
|
||||
);
|
||||
}
|
||||
elementsToInclude.push(element);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue