Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Square selection should work in all directions

hazam8c1af23d59d8
diff --git a/src/index.tsx b/src/index.tsx
index ee1e26a9cc..405cadde9a 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);