Commit graph

5 commits

Author SHA1 Message Date
wfx
d05c459e92 fix: Simplify crop_overlay - NO coordinate transformation
KISS principle: Widget is in stack over canvas, uses SAME coordinates!
- Mouse position = exact position to draw
- selection.region = canvas pixel coordinates
- NO relative/absolute conversion needed
- NO bounds offset calculations

Removed all the over-engineered coordinate math.
2026-02-04 18:25:39 +01:00
wfx
22bf19ddd3 refactor: Remove redundant keyboard handlers from crop_overlay widget
Keyboard events (Enter/Escape) are already handled globally in app.rs
subscription and work correctly with Crop mode detection.

Widget-level keyboard events don't work without focus anyway.
Only mouse events (click, drag, double-click) stay in the widget.
2026-02-04 18:19:44 +01:00
wfx
32468c2758 fix: Crop overlay coordinate system and add Enter/Double-click support
B1: Fixed handle positions - now uses relative coordinates correctly
    - Handles are drawn at correct positions (relative to bounds)
    - Conversion between screen and relative coords

B2: Added Enter and Double-click for Apply
    - Enter key applies crop when selection exists
    - Escape key cancels crop
    - Double-click on selection center applies crop (400ms window)
2026-02-04 18:16:48 +01:00
wfx
531cfef715 refactor: Clean Architecture - Separate domain (CropRegion) from UI (crop_model)
- CropRegion moved to domain/document/operations/crop.rs (pure model)
- crop_types.rs renamed to crop_model.rs (honest UI model name)
- DragHandle and CropSelection stay in UI layer (where they belong)
- Clean separation: Domain has no UI concerns, UI imports from Domain
2026-02-04 16:46:41 +01:00
wfx
be956f701b feat: Implement clean crop overlay (395 lines, simple stack-based approach) 2026-02-04 16:36:35 +01:00