Skip to content

Fix transform problems caused by missing transform data or invalid order of operations #6989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

MarchingCube
Copy link
Collaborator

@MarchingCube MarchingCube commented Nov 21, 2021

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).

transform-fixed

How was the solution implemented (if it's not obvious)?

Added extra Prepend and Append functions to Matrix (naming as in WPF) to better express multiplication semantics.

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes: #6494

@MarchingCube MarchingCube requested a review from jmacato November 21, 2021 22:09
Copy link
Member

@jmacato jmacato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jmacato jmacato merged commit 708f5d9 into AvaloniaUI:master Nov 22, 2021
@MarchingCube MarchingCube deleted the fix-transform-operations-interpolation branch November 22, 2021 01:16
danwalmsley pushed a commit that referenced this pull request Nov 23, 2021
…nterpolation

Fix transform problems caused by missing transform data or invalid order of operations
@maxkatz6 maxkatz6 added the bug label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TransformOperationsTransition "jerks" at the end of the transition
4 participants