fix(zoom): the gesture now creates the box instead of only closing it
Creator report: Ctrl+right in edit mode and left-click in preview did nothing when neither streaming nor recording. The bindings were correct; the action was not. Two causes, both in the model rather than the handler: - ActivateZoom opened with `if (!(IsLive || IsRecording)) return;` — the box could not be created outside a session at all. - ToggleZoom only ever called DismissZoom, so "toggle" could turn it off and never on. Now ToggleZoom(x, y) activates at the cursor or dismisses if already open, and the live-only guard is gone — the magnifier is an editing aid as much as a live one. Both call sites pass the canvas point, so the box still anchors on the click rather than the frame centre. Debug 0 warnings; ZoomBox + ZoomMagnifier tests pass (3).
This commit is contained in:
@@ -479,7 +479,7 @@ public partial class PreviewPane : UserControl
|
||||
// the mode where nothing is editable. Dragging it afterwards is handled by MouseMove.
|
||||
if (!vm.IsEditMode)
|
||||
{
|
||||
vm.ToggleZoom();
|
||||
vm.ToggleZoom(p.X, p.Y);
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
@@ -619,7 +619,10 @@ public partial class PreviewPane : UserControl
|
||||
return;
|
||||
}
|
||||
|
||||
vm.ToggleZoom();
|
||||
var grid = (Grid)sender;
|
||||
var toCanvas = CanvasGrid.TransformToVisual(grid).Inverse;
|
||||
var p = toCanvas.Transform(e.GetPosition(grid));
|
||||
vm.ToggleZoom(p.X, p.Y);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user