-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
bugSomething isn't workingSomething isn't working
Description
taffy version
Tested on 0.9.1
Platform
Testing examples from the taffy repo on OS X
What you did
I adjusted the measure example as follows
To test a grid container with max width set, but width set to auto:
let root = taffy.new_with_children(
Style {
display: Display::Grid,
grid_template_rows: vec![fr(1.0)],
max_size: Size { width: length(200.), height: auto() },
size: Size { width: auto(), height: auto() },
..Default::default()
},
&[text_node, text_node],
)?;
To test a flex container with max width set, but width set to auto:
let root = taffy.new_with_children(
Style {
display: Display::Grid,
grid_template_rows: vec![fr(1.0)],
max_size: Size { width: length(200.), height: auto() },
size: Size { width: auto(), height: auto() },
..Default::default()
},
&[text_node, text_node],
)?;
What went wrong
Both grid layout and flex layout seemed to behave incorrectly when max-width is set, but width is unset on the parent container.
- Grid layout seems to ignore the constraint and give the children 100% of the space as if max size.width is unset:
- Flex layout seems to give children the correct width, but incorrectly uses the results of the measure function and gives the wrong height:
Both of these layouts work as expected in html on google chrome
Additional information
Looked into this because of #21769 bevyengine/bevy#21769 reported to bevy
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working