clean switch of arrows using app state

This commit is contained in:
Ryan Di 2025-04-22 23:07:15 +10:00
parent 67793860b4
commit c90cdb7b74
2 changed files with 50 additions and 9 deletions

View file

@ -38,6 +38,7 @@ export const mutateElement = <TElement extends Mutable<ExcalidrawElement>>(
// If true, the elbow arrow tries to bind to the nearest element. If false
// it tries to keep the same bound element, if any.
isDragging?: boolean;
propertiesToDrop?: string[];
},
): TElement => {
let didChange = false;
@ -128,6 +129,12 @@ export const mutateElement = <TElement extends Mutable<ExcalidrawElement>>(
}
}
if (options?.propertiesToDrop?.includes(key)) {
delete (element as any)[key];
didChange = true;
continue;
}
(element as any)[key] = value;
didChange = true;
}