mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 14:00:56 +02:00
refactor: decoupling global Scene state part-1 (#7577)
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
ExcalidrawElement,
|
||||
NonDeleted,
|
||||
NonDeletedExcalidrawElement,
|
||||
ElementsMapOrArray,
|
||||
} from "./element/types";
|
||||
import {
|
||||
AppClassProperties,
|
||||
@@ -270,9 +271,17 @@ export const isElementInGroup = (element: ExcalidrawElement, groupId: string) =>
|
||||
element.groupIds.includes(groupId);
|
||||
|
||||
export const getElementsInGroup = (
|
||||
elements: readonly ExcalidrawElement[],
|
||||
elements: ElementsMapOrArray,
|
||||
groupId: string,
|
||||
) => elements.filter((element) => isElementInGroup(element, groupId));
|
||||
) => {
|
||||
const elementsInGroup: ExcalidrawElement[] = [];
|
||||
for (const element of elements.values()) {
|
||||
if (isElementInGroup(element, groupId)) {
|
||||
elementsInGroup.push(element);
|
||||
}
|
||||
}
|
||||
return elementsInGroup;
|
||||
};
|
||||
|
||||
export const getSelectedGroupIdForElement = (
|
||||
element: ExcalidrawElement,
|
||||
|
Reference in New Issue
Block a user