Skip to content
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

Fix viewport calculation with non-invertible render transform #13188

Merged

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Oct 9, 2023

What does the pull request do?

This PR prevents the layout manager from crashing when a control has a ScaleTransform of (0, 0) and a viewport must be calculated for one of its child.

What is the current behavior?

The layout manager crashes with InvalidOperationException: Transform is not invertible

What is the updated/expected behavior with this PR?

The layout manager doesn't crash: an empty viewport is returned instead.

A unit test has been added.

Fixed issues

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0040619-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@grokys grokys added this pull request to the merge queue Nov 3, 2023
Merged via the queue into AvaloniaUI:master with commit 9a3cfce Nov 3, 2023
6 checks passed
@MrJul MrJul deleted the fix/zero-scale-transform-effective-viewport branch November 5, 2023 11:59
@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Nov 5, 2023
maxkatz6 pushed a commit that referenced this pull request Dec 5, 2023
* Added failing test for viewport with 0 scale transform

* Fix viewport calculation with non-invertible render transform
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Dec 5, 2023
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.

VirtualizingStackPanel with animated ScaleTransform starting from 0 crashes the renderer
4 participants