Repository navigation
Support single-value scale() and translate() in CSS transform - #39717
johnkaram02 wants to merge 1 commit into
Conversation
Setting the CSS `transform` property to `scale(2)` or `translate(10)` threw an IndexOutOfRangeException from VisualElement.OnTransformChanged, because the handler always read a second comma-separated value. In CSS, `scale(s)` is the same as `scale(s, s)` and `translate(tx)` is the same as `translate(tx, 0)`. Apply those defaults when only one value is present.
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39717Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39717" |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey there @@johnkaram02! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
Hey there @johnkaram02! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit d0a1067.
PR Test Gate
🧪 Gate analysis — click to expand✅ Passed. The selected verification satisfied the gate's passing conditions. Unmatched, skipped, or inconclusive groups are not passing evidence. 🧪 Unit tests
Execution log excerptsWithout fix With fix PR head: d0a10674. Without-fix baseline: b20099cf. |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
transform: scale(2);andtransform: translate(10);threwIndexOutOfRangeExceptioninVisualElement.OnTransformChanged, because the handler always read a second comma-separated value.CSS defines
scale(s)asscale(s, s)andtranslate(tx)astranslate(tx, 0). This change applies those defaults when only one value is present. The two-value forms keep their current behavior.Tests: adds
TransformScaleWithSingleValueScalesBothAxes,TransformTranslateWithSingleValueTranslatesXOnlyandTransformScaleAndTranslateWithTwoValuestoStyleSheets/StyleTests.cs. The first two fail without the change and pass with it. I ranControls.Core.UnitTestson Linux (net10.0): 5868 passed, 30 skipped, 0 failed. I did not test on a device.Issues Fixed
Fixes #