mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-06 09:07:12 +02:00
don't flip video when negative scaling
This commit is contained in:
@@ -587,13 +587,20 @@ export const resizeSingleElement = (
|
||||
};
|
||||
|
||||
if ("scale" in element && "scale" in stateAtResizeStart) {
|
||||
if (isEmbeddableElement(element) && shouldMaintainAspectRatio) {
|
||||
const scale: [number, number] = [
|
||||
eleNewWidth / (stateAtResizeStart.width / stateAtResizeStart.scale[0]),
|
||||
eleNewHeight /
|
||||
(stateAtResizeStart.height / stateAtResizeStart.scale[1]),
|
||||
];
|
||||
mutateElement(element, { scale });
|
||||
if (isEmbeddableElement(element)) {
|
||||
if (shouldMaintainAspectRatio) {
|
||||
const scale: [number, number] = [
|
||||
Math.abs(
|
||||
eleNewWidth /
|
||||
(stateAtResizeStart.width / stateAtResizeStart.scale[0]),
|
||||
),
|
||||
Math.abs(
|
||||
eleNewHeight /
|
||||
(stateAtResizeStart.height / stateAtResizeStart.scale[1]),
|
||||
),
|
||||
];
|
||||
mutateElement(element, { scale });
|
||||
}
|
||||
} else {
|
||||
mutateElement(element, {
|
||||
scale: [
|
||||
|
Reference in New Issue
Block a user