Repository navigation
fix: Square measure for UniformToFill shapes - #23559
Conversation
For Stretch=UniformToFill, Ellipse and Rectangle must report a square desired size (height = width) so an oversized shape produces overflow for Horizontal/VerticalAlignment to act on. MeasureRelativeShape returned new Size(width, height), leaving the desired height at the available height, so vertical alignment had no effect when the shape was wider than its container (issue #18265). This matches WinUI CEllipse::MeasureOverride / CRectangle::MeasureOverride, which both set desiredSize.height = width. Adds Given_Ellipse runtime tests reproducing the issue and a When_RectangleMeasure data row covering the finite UniformToFill case. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15
|
Claude finished @MartinZikmund's task in 3m 31s —— View job PR Review: fix: Square measure for UniformToFill shapes
Overall Verdict: ✅ Approve with minor suggestionsThe core fix is correct and well-reasoned. 2 low-severity findings:
No blocking issues. The fix is scoped exactly as described (only the |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23559/wasm-skia-net9/index.html |
Adds Given_Basic_Shapes_Parity, a Skia runtime test that renders the Basic_Shapes HorizontalAlignment x VerticalAlignment grids for Ellipse and Rectangle across all stretches and sizes, then compares each render against the WinUI golden screenshots (reused, not copied, from the native-only and currently [Ignore]d Basics_Shapes_Tests UI test). This adds the Skia shapes-parity coverage that did not exist before: the original UI test only ran on native iOS/Android, so it never exercised the Skia measure/arrange path where #18265 occurred. All 190 Ellipse/Rectangle configurations now match WinUI. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15
|
Claude finished @MartinZikmund's task in 4m 23s —— View job PR Review: fix: Square measure for UniformToFill shapes
Overall Verdict: ✅ Approve with minor suggestionsCore fix ( Findings
No blocking issues. The fix is correct, the test logic in |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23559/wasm-skia-net9/index.html |
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15
The Basic_Shapes stretch/alignment golden comparison was a UI test that only ran on native iOS/Android and was [Ignore]d, so it never exercised the Skia path where #18265 occurred. Replace it with the Skia runtime test Given_Basic_Shapes_Parity and move the WinUI golden screenshots into the runtime tests library. - Move all 570 expected screenshots from SamplesApp.UITests into Uno.UI.RuntimeTests/Assets/ShapeParityGoldens; load them via ms-appx Content (works across all targets) instead of a cross-project embedded resource. - Extend Given_Basic_Shapes_Parity to all six shapes (Ellipse, Rectangle, Line, Path, Polygon, Polyline) x every stretch x size. All 570 configs match WinUI on Skia, including the ones the old UI test had to exclude on native. - Remove the golden comparison suite from Basics_Shapes_Tests; keep the still active Validate_Offscreen_Shapes browser test. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15
|
Claude finished @MartinZikmund's task in 4m 9s —— View job PR Review: fix: Square measure for UniformToFill shapes
Overall Verdict: ✅ Approve with minor suggestionsLatest commit ( Findings
No new issues introduced by the latest commit. The core fix in |
- Lower Given_Ellipse pixel tolerance 20 -> 5 (per runtime-tests guideline) - Use 'using var' for the parity-test golden bitmap (dispose on all paths) - Clarify the Rectangle UniformToFill row: DesiredSize is clamped to available, so the bug surfaces only in arrange (covered by the pixel-based tests) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15
|
Claude finished @MartinZikmund's task in 2m 50s —— View job PR Review: fix: Square measure for UniformToFill shapes
Overall Verdict: ✅ ApproveAll three findings from prior reviews are resolved in commit
No new issues. The core fix in
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23559/wasm-skia-net9/index.html |
When_CompactPaneLength_Changed_PaneToggleButton_Updates is flaky on native WinUI; exclude it there via PlatformCondition pending the investigation tracked in #23561. Still runs on Skia and WASM. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15
|
Claude finished @MartinZikmund's task in 2m 8s —— View job PR Review: fix: Square measure for UniformToFill shapes
Overall Verdict: ✅ ApproveThe latest commit ( All findings from prior reviews are confirmed resolved:
Core fix ( No new issues introduced by the latest commit. The PR is ready to merge. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23559/wasm-skia-net9/index.html |
|
|
GitHub Issue: closes #18265
PR Type:
🐞 Bugfix
What changed? 🚀
On Skia, an
Ellipse/RectanglewithStretch="UniformToFill"that is wider (or taller) than its container ignoredVerticalAlignment(resp.HorizontalAlignment):Root cause:
MeasureRelativeShapereturnednew Size(width, height)forUniformToFill, wherewidth = Max(availableWidth, availableHeight)butheightwas left as the raw available height. The desired height then equalled the container height, so there was no overflow forVerticalAlignmentto act on.Fix: return a square desired size (
new Size(width, width)). This matches WinUI, where bothCEllipse::MeasureOverrideandCRectangle::MeasureOverridesetdesiredSize.height = width. The change is isolated to theUniformToFillbranch and to the only two shapes that route throughMeasureRelativeShape(Ellipse,Rectangle) — exactly the two shapes WinUI gives this fast-path. The arrange logic on every platform already forces theUniformToFillrender area square, so the corrected square desired size is consistent with arrange everywhere.Tests
Given_Ellipseruntime tests reproducing the issue (Bottom- and Top-aligned), gated#if __SKIA__ || WINAPPSDK.Given_Rectangle.When_RectangleMeasuredata row covering the finiteUniformToFillcase.Given_Basic_Shapes_ParitySkia runtime test that replaces the oldBasics_Shapes_TestsUI test (which only ran on native iOS/Android and was[Ignore]d, so it never exercised the Skia path this bug lived on). It renders theBasic_ShapesHorizontalAlignment × VerticalAlignment grids for all six shapes (Ellipse, Rectangle, Line, Path, Polygon, Polyline) across every stretch and size, and compares each render against the WinUI golden screenshots. All 570 configurations match WinUI on Skia — including the configs the old UI test had to exclude on native.Uno.UI.RuntimeTests/Assets/ShapeParityGoldens) and are loaded viams-appxContent (works across all targets), so the test no longer depends on the soon-to-be-removed UI test project. The old golden comparison suite was deleted fromBasics_Shapes_Tests(the still-activeValidate_Offscreen_Shapesbrowser test is kept).Verified on Skia Desktop: the repro fails before / passes after the fix; the parity test discriminates (a deliberately mis-positioned render measures > 20% pixel difference vs < 0.7% for a correct one, against a 3% threshold); all six shape methods pass.
PR Checklist ✅
Screenshots Compare Test Runresults. — to validate once CI completes🤖 Generated with Claude Code
https://claude.ai/code/session_01CaPHWAaFvY1iT6STp9xL15