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

Call a layout pass on RenderTransform changes #15124

Conversation

Meloman19
Copy link
Contributor

What does the pull request do?

Adds a new InvalidateViewport method to the ILayoutManager. It queues the layout pass for calculating of effective viewport if needed.

What is the current behavior?

EffectiveViewport calculated only with layout pass called with measure or arrange. But RenderTransform effects only to render.

Fixed issues

Fixes #12432

@avaloniaui-bot
Copy link

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

Copy link
Member

@grokys grokys left a comment

Choose a reason for hiding this comment

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

I'm not sure this is the correct way to solve this issue: render transforms are by definition independent of the layout system and a fix like this is either going to queue a lot of layout passes in the case of a render transform animation (a common occurrence) or fail to handle render transform animations (which I think this PR indeed fails to handle).

I think I know how to fix this issue, just need to get time to implement it.

@Meloman19
Copy link
Contributor Author

The title of the PR is a bit misleading. In fact, transform change not invalidated the layout of any element. Just called invalidate viewport.
And if the viewport does not changed, then there will be no following changes in the layout. It's not queue a lot of unnecessary layout passes.

And how are you going to solve this problem?

I see two ways here: or RenderTransform affected to viewport, or not.

  1. If RT affected to viewport, then we need to recalculate the viewport on every time the RT is changed.
  2. If RT not affected to viewport, then we remove RT from CalculateEffectiveViewport.

@MrJul
Copy link
Member

MrJul commented Oct 10, 2024

As per #15124 (review), I'm closing this as it add a dependency from render to layout, which we want to avoid from an architectural perspective (and might cause performance issues).

@MrJul MrJul closed this Oct 10, 2024
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 render only first item
5 participants