Web source: render at canvas size 1920x1080 — full-bleed widgets no longer truncated to upper-left

This commit is contained in:
2026-08-28 11:16:46 -07:00
parent f39ebd96ce
commit 70fe2b80b2
4 changed files with 46 additions and 46 deletions
+8 -8
View File
@@ -45,16 +45,16 @@ public sealed class WebView2Manager : IDisposable
{
if (_sessions.ContainsKey(source.Id)) return;
// OBS model: the page renders ONCE at a stable viewport — the size the
// element was created at (snapshot, never tracked, so dragging the box
// never reflows/truncates the page and no scrollbars appear). The
// captured texture is then stretched by the display (Stretch=Fill) into
// whatever box the user draws, so the frame always bounds content with
// zero dead space. Geometry-agnostic: any widget, any box.
// OBS model: the page renders at the MASTER CANVAS size (1920×1080),
// stable, never tracked. Full-bleed widgets (designed for the canvas)
// render fully instead of being clipped to a small box-sized viewport;
// dragging the box never reflows the page. The capture is cropped to
// the widget's actual content bounds (QueryContentBoundsAsync) and the
// display (Stretch=Fill) maps it flush under the box, anchored at (0,0).
var webView = new WebView2
{
Width = Math.Max(1, source.Width),
Height = Math.Max(1, source.Height),
Width = 1920,
Height = 1080,
DefaultBackgroundColor = System.Drawing.Color.Transparent,
Visibility = System.Windows.Visibility.Visible,
};