Overview
Context: The InkCanvas widget (app/lib/widgets/ink_canvas.dart) has three tools: pen, highlighter, and eraser. The eraser is currently implemented as a white-colored pen stroke — it paints white on top of existing content. This breaks on any non-white background (lined, grid, or dotted templates), and it permanently embeds fake white strokes into the note's stroke data.
The correct behaviour is to remove (or trim) existing strokes that the eraser touches, not add new ones.
What needs to be done
MVP approach — stroke-level deletion
Cleanup
Goal
Using the eraser removes ink strokes visually and from the data. Erasing on a lined template reveals the lines underneath (not a white smear). Undo correctly restores erased strokes.
Where to look
app/lib/widgets/ink_canvas.dart:
_InkCanvasState._onPointerMove() — where new stroke points are added
_InkCanvasState._undoLastStroke() — undo logic
_InkPainter.paint() — rendering (remove the eraser paint path)
InkStrokeData — the stroke model, has id and points
Testing steps
Related to: #8, #14
Overview
Context: The
InkCanvaswidget (app/lib/widgets/ink_canvas.dart) has three tools:pen,highlighter, anderaser. The eraser is currently implemented as a white-colored pen stroke — it paints white on top of existing content. This breaks on any non-white background (lined, grid, or dotted templates), and it permanently embeds fake white strokes into the note's stroke data.The correct behaviour is to remove (or trim) existing strokes that the eraser touches, not add new ones.
What needs to be done
MVP approach — stroke-level deletion
_InkCanvasState, when the eraser tool is active, instead of adding a newInkStrokeDatato_currentStrokes, check which existing strokes fall within the eraser's touch area (use bounding box or point proximity check)bounding_box()method already onInkStrokein the Python model as a reference for the Flutter equivalentsetState()_undoLastStroke) should also undo an erase operation (i.e., restore the removed strokes)Cleanup
BlendModeand transparency hack that currently makes the eraser look like a white stroke in_InkPainterInkTool.eraserfrom the stroke-drawing path in_InkPainter.paint()— eraser should never draw anythingGoal
Using the eraser removes ink strokes visually and from the data. Erasing on a lined template reveals the lines underneath (not a white smear). Undo correctly restores erased strokes.
Where to look
app/lib/widgets/ink_canvas.dart:_InkCanvasState._onPointerMove()— where new stroke points are added_InkCanvasState._undoLastStroke()— undo logic_InkPainter.paint()— rendering (remove the eraser paint path)InkStrokeData— the stroke model, hasidandpointsTesting steps
Related to: #8, #14