-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
style.min_size doesn't override max_size on the cross axis #6737
Comments
Can you reproduce this upstream in |
Okay, I'll have a go. |
It seems to be fixed in Taffy main, except that max_size overrides min_size but I'm not sure if that's intentional. Is this a bug? use taffy::prelude::*;
fn main() {
let mut taffy = Taffy::new();
let child = taffy.new_leaf(
Style {
size: Size {
width: Dimension::Points(2.),
height: Dimension::Points(2.)
},
..Default::default()
}
).unwrap();
let parent = taffy.new_with_children(Style {
size: Size {
width: Dimension::Points(1.),
height: Dimension::Points(1.)
},
..Default::default()
}, &[child]
).unwrap();
let _ = taffy.compute_layout(parent, Size {
width: AvailableSpace::Definite(1.),
height: AvailableSpace::Definite(1.),
});
println!("{:#?}", taffy.layout(child).unwrap().size);
} output:
|
@TimJentzsch, you're much better at these flexbox details than I am :) |
This has been solved by #6743 and is now working. Running the reproduce-code gives the correct results:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bevy version
0.9
What you did
What went wrong
It should draw a 100 x 100 square.
Instead, a 100 wide x 10 tall rectangle is drawn.
Additional information
According to the Flexbox spec, min_size is supposed to override max_size if max_size < min_size.
The problem is with the calculation of the length of the cross-axis, if the Flex direction is set to
FlexDirection::Column
you get a 10 wide x 100 tall box instead.related issue: #5502
The text was updated successfully, but these errors were encountered: