소스 검색

Square selection should work in all directions

hazam 5 년 전
부모
커밋
8c1af23d59
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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);