mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
implementation of resize
This commit is contained in:
parent
6fc85022ae
commit
d783aaa236
1 changed files with 15 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue