Multi-scene webcam (schema v3/v4): singleton Webcam + per-scene WebcamSceneConfig, right-click OBS-style border/context menu, persisted round-to-rect restore + legacy-square 16:9 heal, dark MenuItem template, tests (25 passing)

This commit is contained in:
2026-08-07 08:24:18 -07:00
parent f31ce9fdb7
commit e037ba027b
23 changed files with 1405 additions and 287 deletions
+7 -8
View File
@@ -61,29 +61,28 @@ public sealed class RoundClipInteractionTests
window.UpdateLayout();
var scene = vm.ActiveScene!;
var source = new Source
var webcam = new WebcamSceneConfig
{
WebcamId = "test-camera",
Name = "Webcam",
Type = SourceType.Webcam,
DeviceId = "test-camera",
X = 1408,
Y = 778,
Width = 480,
Height = 270,
};
scene.Sources.Add(source);
vm.SelectedSource = source;
scene.Elements.Add(webcam);
vm.SelectedElement = webcam;
window.UpdateLayout();
var previewGrid = (Grid)window.FindName("PreviewGrid")!;
var canvasGrid = (Grid)window.FindName("CanvasGrid")!;
var toWindow = canvasGrid.TransformToVisual(window);
var corner = new Point(source.X + source.Width, source.Y + source.Height);
var corner = new Point(webcam.X + webcam.Width, webcam.Y + webcam.Height);
foreach (var shape in new[] { ClipShape.Traditional, ClipShape.Round })
{
source.ClipShape = shape;
webcam.ClipShape = shape;
window.UpdateLayout();
var cornerInWindow = toWindow.Transform(corner);
@@ -100,7 +99,7 @@ public sealed class RoundClipInteractionTests
}
// The round clip must render as a circle (square bounding box), not an oval.
source.ClipShape = ClipShape.Round;
webcam.ClipShape = ClipShape.Round;
window.UpdateLayout();
var ellipse = FindRoundEllipse(window);
Assert.NotNull(ellipse);