Preview: promote selected layer for hit testing
Temporarily raise the selected preview item and prioritize it in the custom hit test without changing scene order. Refresh integration-test expectations for Brand logo layers and explicit thumbnail assets. WPF references: https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.panel.zindex?view=windowsdesktop-10.0 https://learn.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/hit-testing-in-the-visual-layer
This commit is contained in:
@@ -49,8 +49,9 @@ public sealed class ZoomBoxInteractionTests
|
||||
window.Show();
|
||||
window.UpdateLayout();
|
||||
Assert.NotNull(vm.StagedScene);
|
||||
// The healed zoom placeholder sits at z-index 1, inert.
|
||||
var placeholder = (ZoomSceneElement)vm.StagedScene.Elements[1];
|
||||
// The healed zoom placeholder is present and inert; persistent scene
|
||||
// layers may precede it, so locate it by type rather than list index.
|
||||
var placeholder = vm.StagedScene.Elements.OfType<ZoomSceneElement>().Single();
|
||||
Assert.False(placeholder.IsZoomActive);
|
||||
Assert.Equal(ElementKind.Static, placeholder.Kind);
|
||||
|
||||
@@ -137,7 +138,7 @@ public sealed class ZoomBoxInteractionTests
|
||||
Assert.True(Math.Abs(vm.ZoomState.Y - boxY) >= 100, "the box must have moved");
|
||||
Assert.Equal(captureX, vm.ZoomState.CaptureX);
|
||||
Assert.Equal(captureY, vm.ZoomState.CaptureY);
|
||||
var zoom = Assert.IsType<ZoomSceneElement>(vm.StagedScene.Elements[1]);
|
||||
var zoom = vm.StagedScene.Elements.OfType<ZoomSceneElement>().Single();
|
||||
Assert.Equal(vm.ZoomState.X, zoom.X, 3);
|
||||
Assert.Equal(vm.ZoomState.Y, zoom.Y, 3);
|
||||
Assert.Equal(captureX, zoom.CaptureX, 3);
|
||||
@@ -179,7 +180,7 @@ public sealed class ZoomBoxInteractionTests
|
||||
|
||||
private static void AssertTrueActiveLayer(MainViewModel vm)
|
||||
{
|
||||
var zoom = Assert.IsType<ZoomSceneElement>(vm.StagedScene!.Elements[1]);
|
||||
var zoom = vm.StagedScene!.Elements.OfType<ZoomSceneElement>().Single();
|
||||
Assert.True(zoom.IsZoomActive);
|
||||
Assert.True(zoom.IsVisible);
|
||||
Assert.Equal(ElementKind.Dynamic, zoom.Kind);
|
||||
@@ -191,4 +192,4 @@ public sealed class ZoomBoxInteractionTests
|
||||
Assert.Equal(vm.ZoomState.CaptureY, zoom.CaptureY, 3);
|
||||
Assert.Equal(vm.ZoomShape == ZoomShape.Circle ? ClipShape.Round : ClipShape.Traditional, zoom.ClipShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user