# Canvas View

## Description
Main editing canvas with pinch-to-zoom, pan, mask overlay, and before/after comparison.

## Acceptance Criteria
- [ ] `CanvasView` SwiftUI view displaying the current edited image
- [ ] Pinch-to-zoom gesture with smooth animation
- [ ] Pan gesture for navigation when zoomed
- [ ] Zoom limits: 1x to 10x
- [ ] Mask overlay modes:
  - Red tint (50% opacity red on masked areas)
  - Marching ants (animated dashed border)
  - Hidden (no overlay)
- [ ] Toggle between overlay modes via UI control
- [ ] Before/after comparison:
  - Long press shows original image
  - Release returns to edited version
  - Optional toggle button for sticky comparison
- [ ] Renders at appropriate resolution for current zoom level
- [ ] Smooth 60fps interaction on A14 devices
- [ ] UI tests for gesture interactions

## Technical Notes
- Use `MagnificationGesture` and `DragGesture` simultaneously
- Consider using UIKit interop (`UIViewRepresentable`) for smoother gestures if needed
- Mask overlay should be composited efficiently (don't re-render full image)
- Use `drawingGroup()` or Metal for overlay rendering if performance issues

## Edge Cases
- Zoom at image boundary: clamp pan to keep image visible
- Very large image: use tiled rendering or lower resolution preview
- No edits yet: before/after shows same image (no-op)
- Rapid gesture changes: debounce if needed to prevent jank
