keep only unique frames when ungrouping
This commit is contained in:
parent
3c96943db3
commit
afed893419
@ -190,12 +190,18 @@ export const actionUngroup = register({
|
|||||||
|
|
||||||
let nextElements = [...elements];
|
let nextElements = [...elements];
|
||||||
|
|
||||||
|
const frameIds: {
|
||||||
|
[id: string]: true;
|
||||||
|
} = {};
|
||||||
const selectedElements = app.scene.getSelectedElements(appState);
|
const selectedElements = app.scene.getSelectedElements(appState);
|
||||||
const frames = selectedElements
|
for (const element of selectedElements) {
|
||||||
.filter((element) => element.frameId)
|
if (element.frameId) {
|
||||||
.map((element) =>
|
frameIds[element.frameId] = true;
|
||||||
app.scene.getElement(element.frameId!),
|
}
|
||||||
) as ExcalidrawFrameElement[];
|
}
|
||||||
|
const frames = Object.keys(frameIds)
|
||||||
|
.map((eid) => app.scene.getElement(eid))
|
||||||
|
.filter((element) => element != null) as ExcalidrawFrameElement[];
|
||||||
|
|
||||||
const boundTextElementIds: ExcalidrawTextElement["id"][] = [];
|
const boundTextElementIds: ExcalidrawTextElement["id"][] = [];
|
||||||
nextElements = nextElements.map((element) => {
|
nextElements = nextElements.map((element) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user