mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
select single element on cmd-click (#2087)
This commit is contained in:
parent
b8f8bc2e32
commit
4c2d34ffd7
4 changed files with 840 additions and 17 deletions
|
@ -86,6 +86,20 @@ export function selectGroupsForSelectedElements(
|
|||
return nextAppState;
|
||||
}
|
||||
|
||||
export const editGroupForSelectedElement = (
|
||||
appState: AppState,
|
||||
element: NonDeleted<ExcalidrawElement>,
|
||||
): AppState => {
|
||||
return {
|
||||
...appState,
|
||||
editingGroupId: element.groupIds.length ? element.groupIds[0] : null,
|
||||
selectedGroupIds: {},
|
||||
selectedElementIds: {
|
||||
[element.id]: true,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export function isElementInGroup(element: ExcalidrawElement, groupId: string) {
|
||||
return element.groupIds.includes(groupId);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue