mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: incorrect scaling due to ignoring bound text when finding selection bounds
This commit is contained in:
parent
bbaa1be1df
commit
f4d21c26f5
1 changed files with 10 additions and 1 deletions
|
@ -632,8 +632,17 @@ export const resizeMultipleElements = (
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// getCommonBoundingBox() uses getBoundTextElement() which returns null for
|
||||||
|
// original elements from pointerDownState, so we have to find and add these
|
||||||
|
// bound text elements manually
|
||||||
|
const boundTextElements = targetElements
|
||||||
|
.map(({ orig }) => getBoundTextElementId(orig))
|
||||||
|
.filter((id): id is string => typeof id === "string")
|
||||||
|
.map((id) => pointerDownState.originalElements.get(id) ?? null)
|
||||||
|
.filter(isBoundToContainer);
|
||||||
|
|
||||||
const { minX, minY, maxX, maxY, midX, midY } = getCommonBoundingBox(
|
const { minX, minY, maxX, maxY, midX, midY } = getCommonBoundingBox(
|
||||||
targetElements.map(({ orig }) => orig),
|
targetElements.map(({ orig }) => orig).concat(boundTextElements),
|
||||||
);
|
);
|
||||||
const direction = transformHandleType;
|
const direction = transformHandleType;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue