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:
@@ -21,7 +21,6 @@ public partial class MainViewModel
|
||||
{
|
||||
public void ActivateZoom(double clickX, double clickY)
|
||||
{
|
||||
if (!(IsLive || IsRecording)) return;
|
||||
var maxW = MasterFrameWidth * 0.7;
|
||||
var maxH = MasterFrameHeight * 0.7;
|
||||
double w, h;
|
||||
@@ -74,9 +73,16 @@ public partial class MainViewModel
|
||||
RefreshZoomUi();
|
||||
}
|
||||
|
||||
public void ToggleZoom()
|
||||
/// <summary>
|
||||
/// The gesture behind the zoom box: activate it centred on the click, or dismiss it if it is
|
||||
/// already open. Both halves live here because the old split (activate while live, dismiss
|
||||
/// only otherwise) made the gesture do nothing at all when idle — the box could be turned off
|
||||
/// but never on (creator, 2026-11-01).
|
||||
/// </summary>
|
||||
public void ToggleZoom(double clickX, double clickY)
|
||||
{
|
||||
if (_zoomState.IsActive) DismissZoom();
|
||||
else ActivateZoom(clickX, clickY);
|
||||
}
|
||||
|
||||
public void DismissZoom()
|
||||
|
||||
Reference in New Issue
Block a user