implementation of resize

This commit is contained in:
Ting Lu 2025-04-15 20:31:33 -04:00
parent 6fc85022ae
commit d783aaa236

View file

@ -1378,9 +1378,22 @@ export const resizeMultipleElements = (
); );
if (keepAspectRatio) { if (keepAspectRatio) {
// If the elements are in a group and shouldMaintainAspectRatio is true(meaning user is holding shift),
// we need to adjust the scaleX or scaleY based on the handleDirection
if(targetElements.some(item => isInGroup(item.latest)) && shouldMaintainAspectRatio) {
if(handleDirection.length === 1) {
if(handleDirection.includes("e") || handleDirection.includes("w")) {
scaleX = scale;
} else if (handleDirection.includes("n") || handleDirection.includes("s")) {
scaleY = scale;
}
}
}
else {
scaleX = scale; scaleX = scale;
scaleY = scale; scaleY = scale;
} }
}
/** /**
* to flip an element: * to flip an element: