Revert ab29ec8: container==content auto-fit made it worse — back to alpha-crop with the container at element size

The container tracks the element's own Width/Height again; the crop stays in the bitmap.
This commit is contained in:
2026-08-28 12:09:13 -07:00
parent ab29ec801d
commit 9b56e88800
7 changed files with 51 additions and 103 deletions
-21
View File
@@ -154,25 +154,4 @@ public sealed class WebView2ManagerTests
Assert.Equal((0, 0, w, h), (x, y, bw, bh));
}
[Fact]
public void ContentCanvasSize_Full_Frame_Maps_To_Canvas()
{
var (cw, ch) = WebView2Manager.ContentCanvasSize(1920, 1080, 1920, 1080);
Assert.Equal((1920.0, 1080.0), (cw, ch));
}
[Fact]
public void ContentCanvasSize_Half_Widget_Is_Half_Canvas()
{
var (cw, ch) = WebView2Manager.ContentCanvasSize(960, 540, 1920, 1080);
Assert.Equal((960.0, 540.0), (cw, ch));
}
[Fact]
public void ContentCanvasSize_Corrects_For_Dpi_Scale()
{
var (cw, ch) = WebView2Manager.ContentCanvasSize(1200, 675, 2400, 1350);
Assert.Equal((960.0, 540.0), (cw, ch));
}
}