Skip to content

Commit 33d6495

Browse files
Add explanatory comment for Math.Min square constraint approach
Co-authored-by: RuntimeRascal <2422222+RuntimeRascal@users.noreply.github.com>
1 parent c0e6f40 commit 33d6495

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Src/GhostDraw/Tools/RectangleTool.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ private void UpdateRectangle(Point startPoint, Point currentPoint, bool isPerfec
131131
double height = Math.Abs(currentPoint.Y - startPoint.Y);
132132

133133
// If Shift is held, make it a perfect square (width = height = min dimension)
134+
// Note: Uses Math.Min (not Math.Max like CircleTool) so the square fits within
135+
// the dragged bounding box, making the final size more predictable and visible
136+
// to the user as they drag. This matches the behavior specified in the issue.
134137
if (isPerfectSquare)
135138
{
136139
double size = Math.Min(width, height);

0 commit comments

Comments
 (0)