Update docs for DC-1 testing, fix toolbar clipping

- Updated DESIGN.md: rendering strategy (no backing bitmap, screen-space
  grid, viewport clamping), added line snap and box tool documentation
- Updated PROGRESS.md: DC-1 testing results and fixes applied
- Updated CLAUDE.md: key conventions for rendering
- Fix toolbar overlap: use clipToBounds on canvas AndroidView to prevent
  it from drawing over the toolbar area

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 15:13:25 -07:00
parent 2b567aa038
commit 85a210c001
4 changed files with 66 additions and 23 deletions

View File

@@ -44,9 +44,10 @@ See PROJECT_PLAN.md for the full step list.
### Phase 3: Canvas — Basic Drawing (2026-03-24)
- [x] 3.13.4: PadCanvasView — stylus input with historical points, Path/Paint
stroke rendering, backing bitmap at 1/4 resolution, 60pt grid, Matrix
coordinate transform (canonical ↔ screen)
- [x] 3.5: CanvasState — tool enum (PEN_FINE, PEN_MEDIUM, ERASER, SELECT),
stroke rendering, direct path drawing (no backing bitmap), 60pt grid
drawn in screen space with pixel-snapped positions, Matrix coordinate
transform (canonical ↔ screen)
- [x] 3.5: CanvasState — tool enum (PEN_FINE, PEN_MEDIUM, ERASER, SELECT, BOX),
zoom/pan state, pen width constants (4.49pt, 5.91pt)
- [x] 3.6: EditorViewModel — loads strokes from Room, saves on completion
- [x] 3.7: EditorScreen + Toolbar — Compose wrapper with AndroidView,
@@ -58,18 +59,19 @@ See PROJECT_PLAN.md for the full step list.
### Phase 4: Zoom and Pan (2026-03-24)
- [x] 4.1: ScaleGestureDetector with focal-point zoom (0.5×4×)
- [x] 4.2: Finger drag for pan with multi-pointer tracking (handles finger
swaps during pinch gestures)
- [x] 4.1: ScaleGestureDetector with focal-point zoom (dynamic min4×)
- [x] 4.2: Finger drag for pan with multi-pointer tracking, pan clamped
so page always fills viewport
- [x] 4.3: Input routing by tool type already in place from Phase 3
- Zoom/pan state managed locally in PadCanvasView for responsiveness,
synced to ViewModel on gesture end
- Minimum zoom computed dynamically from page/view dimensions
### Phase 5: Eraser (2026-03-24)
- [x] 5.15.3: Stroke-level eraser with bounding box hit test (42pt radius),
processes historical touch points for thorough erasing, deletes from
view + Room DB, rebuilds backing bitmap
view + Room DB
### Phase 6: Undo/Redo (2026-03-24)
@@ -110,12 +112,29 @@ See PROJECT_PLAN.md for the full step list.
- [x] 10.3: Empty states and delete confirmations already in place from Phase 2
- [ ] 10.4: Performance profiling — requires on-device testing
### On-Device Testing — Daylight DC-1 (2026-03-24)
Tested on DC-1, identified and fixed rendering issues:
- **Grid**: original grid drawn in canonical space had uneven spacing due to
sub-pixel positioning when scaled. Fixed by drawing grid in screen space
with pixel-snapped line positions. Now uniform squares.
- **Stroke quality**: original backing bitmap at 1/4 resolution caused blurry
strokes. Fixed by removing backing bitmap entirely and drawing paths directly.
Anti-aliasing disabled on all paint for crisp e-ink lines.
- **Viewport**: dark gray background was visible around page edges. Fixed by
clamping pan to page edges, computing dynamic min zoom, and white background.
- **Box tool**: works correctly on device.
- **PDF export**: correctly elides grid — confirmed on device.
- **Line snap**: increased threshold to 60pt (~5mm) and switched to max-distance
tracking to handle EMR stylus hand tremor.
## Status
All implementation phases complete. Remaining work:
- On-device testing on Supernote Manta and Daylight DC-1
- Performance profiling (stroke rendering, page load times)
- Manual verification of PDF export fidelity
- Test on Supernote Manta
- Verify line snap behavior on device
- Performance profiling with heavily annotated pages
## Decisions & Deviations