Browse Source

Merge pull request #168 from nanot1m/fix-square-selection

Square selection should work in all directions
pull/176/head
Giovanni Giordano 6 years ago committed by GitHub
parent
commit
be41bd0f1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/index.tsx

4
src/index.tsx

@ -1542,7 +1542,9 @@ class App extends React.Component<{}, AppState> { @@ -1542,7 +1542,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);

Loading…
Cancel
Save