feat: new area eraser#1761
Draft
Imagination-King wants to merge 4 commits into
Draft
Conversation
…s instead of whole lines. Both area eraser and original (stroke eraser) freely accessible through new eraser modal.
There was a problem hiding this comment.
1 issue found across 12 files
Confidence score: 4/5
- This PR appears safe to merge overall, with one moderate UI issue rather than a functional breakage or data/security risk.
- In
lib/components/toolbar/eraser_modal.dart, the axis-dependent layout currently uses a width-only spacer, so in vertical orientation the expected spacing between controls is lost and the modal can look cramped. - The issue is scoped and well-defined (severity 5/10, high confidence), which suggests low-to-moderate merge risk if the vertical layout behavior is acceptable short-term.
- Pay close attention to
lib/components/toolbar/eraser_modal.dart- axis-specific spacing should be adjusted so vertical orientation preserves intended control gaps.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1761 +/- ##
==========================================
- Coverage 52.15% 51.59% -0.57%
==========================================
Files 131 132 +1
Lines 9383 9646 +263
==========================================
+ Hits 4894 4977 +83
- Misses 4489 4669 +180 ☔ View full report in Codecov by Harness. |
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.
Closes: #40
This is my first time contributing to an open-source project, so please feel free to correct me on anything I may be doing wrong.
As requested by several users, a new eraser has been added that erases parts of a line instead of the whole line. It basically separates each affected stroke into individual points, and recalculates them back into smaller strokes after the erasing is complete. This new tool is accessible from the new eraser modal (designed to look and operate much like the pen modal), where the size of the eraser's "impact" can also be adjusted. Two new custom icons have also been added to help differentiate between the original stroke eraser and the new area eraser.
Summary by cubic
Adds a new area eraser that removes only the touched part of a stroke, plus an eraser modal to switch modes and adjust size. This improves precision erasing and adds persistence and full undo/redo support.
New Features
assets/images/eraser-*.svgicons; toolbar opens modal when eraser is active; layout adapts to toolbar orientation.stows.lastEraserSize,stows.lastEraserAreaMode).eraseAreatype recordsreplacementStrokesfor correct undo/redo.Refactors
Erasernow keepscurrentEraser, supports area mode, and returnsEraserResultwith erased and replacement strokes.Eraser.currentEraser; toolbar toggles the eraser modal; addedToolOptions.eraser.StrokeaddspointVectorsandreplacePointsfor partial updates.Note: Saber is trialling Cubic AI code review. AI output may contain mistakes, misconceptions, and hallucinations. You can act on the AI feedback if you find it helpful; otherwise you can disregard it and wait for a human reviewer.
Written for commit fbdc889. Summary will update on new commits.