Repository navigation
Fix ContentIsland-hosted content rendering at reduced size on scaled displays - #16383
Collin Schneide (FaithfulAudio) wants to merge 1 commit into
Conversation
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.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Fixes undersized ContentIsland content on scaled displays by applying the display scale to its placement visual.
Changes:
- Applies
pointScaleFactorbefore 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.
| 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 |
There was a problem hiding this comment.
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.
|
Friendly bump — this has been open for a while without a decision. Is there anything you need from me to move it along (rebase onto current main, splitting it, extra tests)? Happy to update it either way. |
Summary
Content hosted through
ContentIslandComponentView(XAML islands viaChildSiteLink, 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:ShouldApplyRasterizationScale = falsemeans the host owns applying the island's rasterization scale at presentation. But the placementContainerVisualpassed toChildSiteLink::Createsits 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:
LocalToParentTransformMatrix— visually inert; that matrix maps coordinates for input/popup placement (issue Pop-ups of Xaml controls need positioning and dismissal #15557), not visual presentation.OverrideScaleviaIContentSite—ChildSiteLinkdoes not answer that QI.Fix
Scale the placement visual by
pointScaleFactorbefore 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):
maincarries 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
DidRasterizationScaleChangefor monitor moves — the current change covers the initial connect, which is where the constant-scale case breaks).Microsoft Reviewers: Open in CodeFlow