mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-18 06:50:31 +02:00
fix: angles not flipping vertically when resizing
This commit is contained in:
@@ -52,6 +52,9 @@ import {
|
||||
import { getMaxContainerWidth } from "./newElement";
|
||||
|
||||
export const normalizeAngle = (angle: number): number => {
|
||||
if (angle < 0) {
|
||||
return angle + 2 * Math.PI;
|
||||
}
|
||||
if (angle >= 2 * Math.PI) {
|
||||
return angle - 2 * Math.PI;
|
||||
}
|
||||
@@ -667,7 +670,10 @@ const resizeMultipleElements = (
|
||||
targetElements.forEach((element) => {
|
||||
const width = element.orig.width * scale;
|
||||
const height = element.orig.height * scale;
|
||||
const angle = element.orig.angle * flipFactorX * flipFactorY;
|
||||
const angle = normalizeAngle(
|
||||
(isFlippedByY ? Math.PI - element.orig.angle : element.orig.angle) *
|
||||
flipFactorX,
|
||||
);
|
||||
|
||||
const hasPoints =
|
||||
isLinearElement(element.orig) || isFreeDrawElement(element.orig);
|
||||
|
Reference in New Issue
Block a user