fix: points not being normalized on single-elem resize (#5581)

This commit is contained in:
David Luzar 2022-08-16 21:51:43 +02:00 committed by GitHub
parent 27cf5ed17e
commit ad0c4c4c78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 4 deletions

View file

@ -495,6 +495,7 @@ export const getResizedElementAbsoluteCoords = (
element: ExcalidrawElement,
nextWidth: number,
nextHeight: number,
normalizePoints: boolean,
): [number, number, number, number] => {
if (!(isLinearElement(element) || isFreeDrawElement(element))) {
return [
@ -508,7 +509,8 @@ export const getResizedElementAbsoluteCoords = (
const points = rescalePoints(
0,
nextWidth,
rescalePoints(1, nextHeight, element.points),
rescalePoints(1, nextHeight, element.points, normalizePoints),
normalizePoints,
);
let bounds: [number, number, number, number];