Fix transform problems caused by missing transform data or invalid order of operations #6989
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.
What does the pull request do?
Fixes issues found by #6494.
What is the current behavior?
As in the issue, there is a jump at the end of the transition caused by invalid interpolation.
Translation wouldn't reach target value so when progress hits 100% we would switch to a target transform and a jump is observed.
What is the updated/expected behavior with this PR?
I've checked workarounds too and it seems that something like
translate(0px, 0px) scale(1.0)
was not working as initial transform value. Due to broken interpolation we would end up with a singular matrix and visual would just disappear.Root of the problem was invalid order of transform multiplication, Avalonia matrix multiplication is post order by default and to compose interpolated transform matrix we need to apply values in pre order (as outlined in the spec and confirmed in Chromium implementation).
How was the solution implemented (if it's not obvious)?
Added extra
Prepend
andAppend
functions toMatrix
(naming as in WPF) to better express multiplication semantics.Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues
Fixes: #6494