Explorar o código

Square selection should work in all directions

hazam %!s(int64=5) %!d(string=hai) anos
pai
achega
8c1af23d59
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/index.tsx

+ 3 - 1
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);