mirror of
https://github.com/excalidraw/excalidraw
synced 2025-07-25 13:58:22 +08:00
fix: perf regression in getCommonBounds
(#8429)
This commit is contained in:
@ -749,11 +749,10 @@ export const getCommonBounds = (
|
||||
let minY = Infinity;
|
||||
let maxY = -Infinity;
|
||||
|
||||
const _elementsMap = elementsMap || arrayToMap(elements);
|
||||
|
||||
elements.forEach((element) => {
|
||||
const [x1, y1, x2, y2] = getElementBounds(
|
||||
element,
|
||||
elementsMap || arrayToMap(elements),
|
||||
);
|
||||
const [x1, y1, x2, y2] = getElementBounds(element, _elementsMap);
|
||||
minX = Math.min(minX, x1);
|
||||
minY = Math.min(minY, y1);
|
||||
maxX = Math.max(maxX, x2);
|
||||
|
Reference in New Issue
Block a user