From 8c1af23d59d87b061f2321b5719776f52a2dc6a9 Mon Sep 17 00:00:00 2001 From: hazam Date: Sun, 5 Jan 2020 23:26:32 +0500 Subject: [PATCH] Square selection should work in all directions --- src/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index ee1e26a9..405cadde 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1537,7 +1537,9 @@ class App extends React.Component<{}, AppState> { this.state.scrollY; draggingElement.width = width; // Make a perfect square or circle when shift is enabled - draggingElement.height = e.shiftKey ? width : height; + draggingElement.height = e.shiftKey + ? Math.abs(width) * Math.sign(height) + : height; generateDraw(draggingElement);