Files
LlamaCasty/HANDOFF.md
T
gramps 966e718f1e Zoom: fix preview zoom box + shape-aspect anchoring (Unit: zoom box visuals)
Right-click in the live preview now procs a box that is actually visible and
populated with the zoomed region, and each Zoom View Shape sculpts the box per
spec. OBS-style derivative: magnifier box shows the composited region and dims
the surroundings (same pattern as OBS "zoom" / preview region highlights).

Root causes of the invisible box (two WPF traps, recorded in MyMistakes.md):
- Empty <VisualBrush Stretch="None"/> used as an OpacityMask paints nothing,
  so the mask alpha is 0 and the WHOLE box (border included) went transparent.
- ZoomBox lived inside CanvasGrid while its VisualBrush sampled CanvasGrid — a
  circular reference WPF renders as nothing. Hoisted ZoomBox to a sibling of
  CanvasGrid inside a new PreviewCanvas wrapper (same 1920x1080 space).

Shape semantics (MainViewModel.ActivateZoom):
- Circle: square, click point = center.
- VerticalRectangle (phone): tall 9:16, click point = top-left corner.
- HorizontalRectangle (tablet): wide 16:9, click point = top-left corner.
- Boxes stay fully inside 1920x1080 via Math.Clamp.

UI: ZoomRectOutline/ZoomCircleOutline shapes replace the square Border;
circle clips the box to an EllipseGeometry; brush Visual released when inactive.
Zoom View Shape dropdown now uses the standard YtComboBox style.

Test (Good Dog rule, one integration test): ZoomBoxInteractionTests verifies
aspect/anchoring/clamp per shape and the matching outline+clip in the real
MainWindow. Full suite 404 passed, 0 warnings.

Memory: HANDOFF.md zoom state updated; WPF VisualBrush traps appended to
MyMistakes.md.
2026-10-07 20:46:45 -07:00

2.2 KiB

HANDOFF — 2026-10-07

Branch

  • main (no feature branch)

Dirty files

  • None (zoom box fix + test committed as a work unit this session).

What just happened

  • Fixed the zoom box: right-click in live preview now procs the selected Zoom View Shape with correct anchoring and a visible, populated box (previously invisible — empty OpacityMask made the whole box transparent and the VisualBrush pointed at the CanvasGrid ancestor, a circular reference WPF renders as nothing).
  • Zoom View Shape dropdown now uses the app's standard YtComboBox style.
  • One integration test added (Good Dog Rule): ZoomBoxInteractionTests — circle is a centered square, phone is a tall 9:16 rect and tablet a wide 16:9 rect, both anchored top-left at the click, box stays inside 1920x1080 (clamp), and the UI shows the right outline/clip per shape. Full suite: 404 passed, 0 warnings.

Zoom feature state

  • Models/ZoomState.cs + Models/ZoomShape.cs (Circle, VerticalRectangle, HorizontalRectangle)
  • ViewModel: zoom box activation/move/dismiss; compositor output crops+scales the zoom region; dimming updates
  • PreviewPane: zoom box is a sibling of CanvasGrid inside a new PreviewCanvas wrapper (so the VisualBrush can sample CanvasGrid without a circular reference); shape-aware outline (ZoomRectOutline/ZoomCircleOutline) + ellipse clip for Circle
  • Shape semantics in MainViewModel.ActivateZoom: Circle = click point is center, w=h=min(maxW,maxH); VerticalRectangle = 9:16 tall, HorizontalRectangle = 16:9 wide, both anchored top-left at the click; clamped to frame
  • Settings (OverlayHost) Zoom View Shape persisted via LayoutStore

Known issues / follow-ups

  • Background toggle bug mentioned earlier: when clicking "Use default background" in layer properties, nothing happens. Need to investigate - binding exists (UseDefaultBackground), VM has handler that invalidates bake and updates. May need to look up Source background logic.

Next step

  • User runs the app live/test to eyeball the zoom box visuals (border shows, region content visible, circle is round, phone/tablet anchored at the click point). Then background "Use default background" toggle if still needed. Otherwise stand down.