Open ids1024 opened 1 year ago
Length::Shrink
is documented as/// Fill the least amount of space
This definitely seems not to match the implementation. Shrink
is really "determine size based on intrinsic size of the content". IMO this is a sensible sizing mode to have (although as you've noticed doesn't work too well for images where the native size may not be that relevant), but it would be better named as Content
, MinContent
, HugContents
or similar.
Yes, you are correct. I think we should rename it to FitContent
.
Is there an existing issue for this?
Is this issue related to iced?
What happened?
In this example, with a window less than 1000px tall, only the first
image
is displayed, filling the height.But if
Shrink
is changed toFill
, the height is distributed equally.It seems
Length::Shrink::fill_factor()
returns0
, and the flex logic doesn't seem to handle that properly.What is the expected behavior?
Presumably it shouldn't be the case that widgets do shrink with
Length::Fill
but not withLength::Shrink
. (If not, the names aren't quite appropriate.)In this particular case
Shrink
should behave the same way asFill
, but the exact right logic may be subtle since there could be children with different types ofLength
, of varying sizes.Length::Shrink
is documented as/// Fill the least amount of space
. The flex logic here might make more sense if this really was the minimum space the widget can take up, but this clearly doesn't match how images work (since they can shrink arbitrarily).Version
master
Operative System
Linux
Do you have any log output?
No response