fix: image elements not flipping its content

This commit is contained in:
Alex Kim 2022-08-19 11:23:16 +05:00
parent a941173be4
commit d1be72ffc2
No known key found for this signature in database
GPG key ID: CEE74CFA44D238D7

View file

@ -25,6 +25,7 @@ import {
isArrowElement,
isBoundToContainer,
isFreeDrawElement,
isImageElement,
isLinearElement,
isTextElement,
} from "./typeChecks";
@ -694,6 +695,7 @@ const resizeMultipleElements = (
points?: Point[];
fontSize?: number;
baseline?: number;
scale?: [-1 | 1, -1 | 1];
} = {
width,
height,
@ -737,6 +739,10 @@ const resizeMultipleElements = (
}
}
if (isImageElement(element.orig)) {
update.scale = [flipFactorX, flipFactorY];
}
updateBoundElements(element.latest, { newSize: { width, height } });
mutateElement(element.latest, update);