Skip to content

Fix ContentIsland-hosted content rendering at reduced size on scaled displays - #16383

Open
Collin Schneide (FaithfulAudio) wants to merge 1 commit into
microsoft:mainfrom
FacilitronWorks:fix/content-island-placement-scale
Open

Fix ContentIsland-hosted content rendering at reduced size on scaled displays#16383
Collin Schneide (FaithfulAudio) wants to merge 1 commit into
microsoft:mainfrom
FacilitronWorks:fix/content-island-placement-scale

Conversation

@FaithfulAudio

@FaithfulAudio Collin Schneide (FaithfulAudio) commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Content hosted through ContentIslandComponentView (XAML islands via ChildSiteLink, e.g. a WebView2) renders at reduced size in the top-left of its frame on any display above 100% scale. At 200% it is exactly half size. The content is otherwise healthy — laid out at the right DIP size and rasterized at the right scale — it is only presented unscaled.

Root cause

Measured live from a production RNW 0.83.2 new-architecture app on a 200% display, by logging the child site's state at ConnectInternal:

parentScale=1.00  rasterScale=2.00  shouldApplyRasterizationScale=false  actualSize=1368x728  pointScaleFactor=2.00

ShouldApplyRasterizationScale = false means the host owns applying the island's rasterization scale at presentation. But the placement ContainerVisual passed to ChildSiteLink::Create sits in RNW's physical-pixel composition tree with no scale, so island content lays out at DIP size (1368×728), rasterizes at 2×, and presents at 1× — half size on screen.

Two other candidate fixes were tried first and eliminated on device:

Fix

Scale the placement visual by pointScaleFactor before connecting. Content then lays out at DIP size, rasterizes at scale, and presents at scale — full-size and pixel-sharp (raster scale matches presentation scale 1:1, so no resampling blur).

At 100% display scale this is Scale(1,1,1) — an identity transform — so configurations already covered by CI are provably unaffected; the change only takes effect where the bug reproduces.

Validation

Applied to the 0.83.2 package sources in a production app (WebView2-hosted maplibre basemap inside the island):

  • Before: island painted exactly half-size in the top-left quadrant at 200% scale ("Invalid visual/content size" also observed via OutputDebugString from sizing churn).
  • After: island fills its frame edge to edge, pixel-sharp at 200%; verified across window resizes and repeated island mounts.
  • main carries the identical placement code at both transform sites, so the defect is live on current heads.

Happy to adjust if you'd prefer the scale applied elsewhere in the island bring-up (e.g. tracked against DidRasterizationScaleChange for monitor moves — the current change covers the initial connect, which is where the constant-scale case breaks).

Microsoft Reviewers: Open in CodeFlow

The child site reports ShouldApplyRasterizationScale = false, meaning the
host owns applying the island rasterization scale at presentation. The
placement visual lives in the physical-pixel composition tree unscaled, so
hosted content laid out in DIPs and rasterized at RasterizationScale
presented at 1x: on a 200% display, islands rendered at exactly half size
in the top-left of their frame. Scale the placement visual by
pointScaleFactor; at 100% display scale this is an identity transform.
Copilot AI balanced review requested due to automatic review settings August 20, 2026 23:48
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes undersized ContentIsland content on scaled displays by applying the display scale to its placement visual.

Changes:

  • Applies pointScaleFactor before connecting the island.
  • Documents the scaling rationale and observed behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +85 to +86
const float placementScale = m_layoutMetrics.pointScaleFactor;
placementVisual.Scale({placementScale, placementScale, 1.0f});

ChildSiteLink().ActualSize({m_layoutMetrics.frame.size.width, m_layoutMetrics.frame.size.height});

// The child site reports ShouldApplyRasterizationScale = false: the host is

ChildSiteLink().ActualSize({m_layoutMetrics.frame.size.width, m_layoutMetrics.frame.size.height});

// The child site reports ShouldApplyRasterizationScale = false: the host is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prefer putting long descriptions like this into the PR description. Having such long bug explanation comments inside of the code reduces the code readability.
If comment is needed, then it should be relatively short and be useful for understanding code later outside of the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants