Fix eraser tool for rectangles/circles + add shift modifier for perfect squares#29
Merged
RuntimeRascal merged 6 commits intomainfrom Dec 8, 2025
Merged
Conversation
…t squares Co-authored-by: RuntimeRascal <2422222+RuntimeRascal@users.noreply.github.com>
Co-authored-by: RuntimeRascal <2422222+RuntimeRascal@users.noreply.github.com>
Co-authored-by: RuntimeRascal <2422222+RuntimeRascal@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix eraser tool to support rectangles and circles
Fix eraser tool for rectangles/circles + add shift modifier for perfect squares
Dec 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eraser tool only removed polylines and lines, ignoring rectangles and circles. Rectangle tool lacked shift-to-constrain functionality present in circle tool.
Changes
Eraser Tool (
EraserTool.cs)RectangleandEllipseshapes usingIntersectsWith()Canvas.GetLeft/GetTopto handle uninitialized attached propertiesRectangle Tool (
RectangleTool.cs)OnMouseMoveandFinishRectangleto constrain to perfect squareMath.Min(width, height)to fit square within dragged bounds (differs from circle tool'sMath.Maxapproach per issue spec)Original prompt
This section details on the original issue you should resolve
<issue_title>Eraser Tool Cannot Erase Rectangles/Circles + Add Perfect Square Modifier</issue_title>
<issue_description>## Bug/Enhancement: Eraser Tool Shape Support + Rectangle Perfect Squares
Issues
1. Eraser Tool Cannot Erase Rectangles and Circles (BUG)
Description:
The Eraser tool currently only erases Polylines (pen strokes) and Lines (straight line tool), but does not erase Rectangle or Circle shapes. This creates an inconsistent user experience where some drawn elements cannot be removed.
Current Behavior:
Expected Behavior:
All drawn shapes should be erasable with the Eraser tool, regardless of which tool created them.
Impact:
2. Rectangle Tool - Add Perfect Square Modifier (ENHANCEMENT)
Description:
Add Shift modifier to Rectangle tool to constrain proportions and create perfect squares.
Proposed Behavior:
User Interaction:
Uto activate Rectangle toolProposed Solutions
Part 1: Fix Eraser Tool for Rectangles and Circles
Root Cause:
The
EraserTool.cslikely only checks forPolylineandLineshape types in its intersection detection logic.Implementation:
Update
Src/GhostDraw/Tools/EraserTool.cs:Files to Modify:
Src/GhostDraw/Tools/EraserTool.cs- Add Rectangle and Ellipse handlingTesting:
Tests/GhostDraw.Tests/EraserToolTests.csPart 2: Add Shift Modifier for Perfect Squares
Implementation:
Update
Src/GhostDraw/Tools/RectangleTool.cs:Files to Modify:
Src/GhostDraw/Tools/RectangleTool.cs- Add Shift key detection and constraint logicDocumentation Updates:
README.md- Mention Shift modifier for squaresViews/OverlayWindow.xaml- Update F1 help overlayCHANGELOG.md- Document enhance...💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.