Skip to content

fix re-computing layout moves children of non-zero positioned parent#2

Merged
jkelleyrtp merged 1 commit intoDioxusLabs:masterfrom
ealmloff:master
Apr 4, 2022
Merged

fix re-computing layout moves children of non-zero positioned parent#2
jkelleyrtp merged 1 commit intoDioxusLabs:masterfrom
ealmloff:master

Conversation

@ealmloff
Copy link
Copy Markdown
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
Copy Markdown
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