Square selection should work in all directions

This commit is contained in:
hazam 2020-01-05 23:26:32 +05:00
parent 06b77326bf
commit 8c1af23d59

View File

@ -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);