mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Don't trigger update for selection element mutations
This commit is contained in:
parent
6668945282
commit
56fb7aec44
10 changed files with 71 additions and 69 deletions
|
@ -450,12 +450,13 @@ class Scene {
|
|||
options,
|
||||
);
|
||||
|
||||
// skip triggerUpdate if the element version hasn't changed
|
||||
if (prevVersion === nextVersion) {
|
||||
return element;
|
||||
}
|
||||
|
||||
if (options.informMutation) {
|
||||
if (
|
||||
// skip if the element is not in the scene (i.e. selection)
|
||||
this.elementsMap.has(element.id) &&
|
||||
// skip if the element's version hasn't changed, as mutateElement returned the same element
|
||||
prevVersion !== nextVersion &&
|
||||
options.informMutation
|
||||
) {
|
||||
this.triggerUpdate();
|
||||
}
|
||||
|
||||
|
|
|
@ -423,6 +423,7 @@ export const maybeBindLinearElement = (
|
|||
pointerCoords: { x: number; y: number },
|
||||
scene: Scene,
|
||||
): void => {
|
||||
const elements = scene.getNonDeletedElements();
|
||||
const elementsMap = scene.getNonDeletedElementsMap();
|
||||
|
||||
if (appState.startBoundElement != null) {
|
||||
|
@ -436,7 +437,7 @@ export const maybeBindLinearElement = (
|
|||
|
||||
const hoveredElement = getHoveredElementForBinding(
|
||||
pointerCoords,
|
||||
scene.getNonDeletedElements(),
|
||||
elements,
|
||||
elementsMap,
|
||||
appState.zoom,
|
||||
isElbowArrow(linearElement),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue