mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: make bounds independent of scene (#7679)
* fix: make bounds independent of scene * pass only elements to getCommonBounds * lint * pass elementsMap to getVisibleAndNonSelectedElements
This commit is contained in:
parent
9013c84524
commit
79d9dc2f8f
11 changed files with 106 additions and 59 deletions
|
@ -269,6 +269,7 @@ const getReferenceElements = (
|
|||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
selectedElements: NonDeletedExcalidrawElement[],
|
||||
appState: AppState,
|
||||
elementsMap: ElementsMap,
|
||||
) => {
|
||||
const selectedFrames = selectedElements
|
||||
.filter((element) => isFrameLikeElement(element))
|
||||
|
@ -278,6 +279,7 @@ const getReferenceElements = (
|
|||
elements,
|
||||
selectedElements,
|
||||
appState,
|
||||
elementsMap,
|
||||
).filter(
|
||||
(element) => !(element.frameId && selectedFrames.includes(element.frameId)),
|
||||
);
|
||||
|
@ -293,6 +295,7 @@ export const getVisibleGaps = (
|
|||
elements,
|
||||
selectedElements,
|
||||
appState,
|
||||
elementsMap,
|
||||
);
|
||||
|
||||
const referenceBounds = getMaximumGroups(referenceElements, elementsMap)
|
||||
|
@ -580,6 +583,7 @@ export const getReferenceSnapPoints = (
|
|||
elements,
|
||||
selectedElements,
|
||||
appState,
|
||||
elementsMap,
|
||||
);
|
||||
return getMaximumGroups(referenceElements, elementsMap)
|
||||
.filter(
|
||||
|
@ -1296,6 +1300,7 @@ export const getSnapLinesAtPointer = (
|
|||
elements,
|
||||
[],
|
||||
appState,
|
||||
elementsMap,
|
||||
);
|
||||
|
||||
const snapDistance = getSnapDistance(appState.zoom.value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue