mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
implement shift+resize for all sides (#210)
This commit is contained in:
parent
b12ea7de3e
commit
1443cf1cd5
1 changed files with 19 additions and 5 deletions
|
@ -712,19 +712,33 @@ class App extends React.Component<{}, AppState> {
|
|||
switch (resizeHandle) {
|
||||
case "nw":
|
||||
element.width += element.x - lastX;
|
||||
element.height += element.y - lastY;
|
||||
element.x = lastX;
|
||||
if (e.shiftKey) {
|
||||
element.y += element.height - element.width;
|
||||
element.height = element.width;
|
||||
} else {
|
||||
element.height += element.y - lastY;
|
||||
element.y = lastY;
|
||||
}
|
||||
break;
|
||||
case "ne":
|
||||
element.width = lastX - element.x;
|
||||
if (e.shiftKey) {
|
||||
element.y += element.height - element.width;
|
||||
element.height = element.width;
|
||||
} else {
|
||||
element.height += element.y - lastY;
|
||||
element.y = lastY;
|
||||
}
|
||||
break;
|
||||
case "sw":
|
||||
element.width += element.x - lastX;
|
||||
element.x = lastX;
|
||||
if (e.shiftKey) {
|
||||
element.height = element.width;
|
||||
} else {
|
||||
element.height = lastY - element.y;
|
||||
}
|
||||
break;
|
||||
case "se":
|
||||
element.width += x - lastX;
|
||||
|
|
Loading…
Add table
Reference in a new issue