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 re-computing layout moves children of non-zero positioned parent #2

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

ealmloff
Copy link
Member

Currently calling compute_layout on a tree where some element is a child of an element whose position is non-zero will move the child.
round_layout rounds the layout and calculates the position of children and is called every time compute is called. When the layout is cached round_layout is called a second time, and adds the parent's position to the child again, causing the movement.

@jkelleyrtp
Copy link
Member

I think I understand this now, and this is a way better optimization than what was there originally. Thank you!

@jkelleyrtp jkelleyrtp merged commit ab443fa into DioxusLabs:master Apr 4, 2022
jkelleyrtp added a commit that referenced this pull request Oct 10, 2022
fix re-computing layout moves children of non-zero positioned parent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants