Repository navigation
Honor RenderTransformOrigin in CompositeTransform - #23163
Merged
MartinZikmund merged 2 commits intoMay 2, 2026
Merged
MartinZikmund merged 2 commits into
MartinZikmund merged 2 commits into
Conversation
Only the Scale sub-transform was using the origin-adjusted center; Skew and Rotate fell back to the raw CenterX/CenterY, so a non-zero RenderTransformOrigin was silently ignored for any composite that included rotation or skew. Routes the combined center into all three sub-transforms and renames the locals so the case-only difference with the property names can no longer hide a regression. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Hosts elements with the broken parameter combinations (rotation, skew, scale, additive origin + local center, the clock-hand 14x200 case) and verifies their TransformToVisual mappings. All assertions go through public API so the same suite runs on Uno Skia, Uno mobile, Uno WASM, and native WinUI as a parity check. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
RenderTransformOrigin in CompositeTransform
MartinZikmund
enabled auto-merge
April 30, 2026 12:04
MartinZikmund
requested review from
Xiaoy312,
ajpinedam,
morning4coffe-dev and
ramezgerges
April 30, 2026 12:04
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes backend-specific matrix generation for CompositeTransform so RenderTransformOrigin is honoured consistently across Scale/Skew/Rotate (matching WinUI behavior), and adds runtime tests to prevent regressions and validate parity.
Changes:
- Fix
CompositeTransform.ToMatrix(absoluteOrigin)to use the origin-adjusted combined center for Scale/Skew/Rotate (not just Scale). - Rename locals to avoid case-only collisions that could obscure regressions.
- Add
Given_CompositeTransformruntime tests covering origin + local center stacking and real-world scenarios (including the 14×200 “clock hand” repro).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Uno.UI/UI/Xaml/Media/CompositeTransform.cs |
Routes the combined center (absolute origin + local CenterX/Y) into Scale/Skew/Rotate matrix generation to match WinUI pivoting. |
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media/Given_CompositeTransform.cs |
Adds runtime tests validating point mappings via TransformToVisual across key CompositeTransform + RenderTransformOrigin combinations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23163/wasm-skia-net9/index.html |
Contributor
|
|
morning4coffe-dev
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CompositeTransform.ToMatrix(absoluteOrigin)was passing the origin-adjusted center only toScale, leavingSkewandRotatepivoting on the rawCenterX/CenterY. Routes the combined center into all three sub-transforms (matching WinUI'sTranslate(-C) * Scale * Skew * Rotate * Translate(C+t)ordering) and renames the locals so the case-only collision with the property names can no longer hide a regression.Given_CompositeTransformruntime tests that host elements with the broken parameter combinations (rotation, skew, scale, origin + local-center stacking, the user's clock-hand 14×200 case) and assert mappings viaTransformToVisual. Coverage runs on every backend including native WinUI as a parity check.Closes #23162.
Test plan
Given_CompositeTransformruntime tests pass on Skia Desktop (8/8)Given_CompositeTransformruntime tests pass on native WinUI (parity check)🤖 Generated with Claude Code