Open DJMcNab opened 1 week ago
See also the CSS images model.
FillStrat
could also probably be renamed. It most closely matches object-fit
web property, with a couple of extra variants. I don't think the current name accurately describes what is being covered - the "image size" as compared to the layout size aren't really meaningfully different except in very rare cases (primarily because of use of sized_box
).
Alternatively, it could be removed entirely, to be brought back when we implement more of the CSS images model.
This is the issue from the TODO comment at: https://github.com/linebender/xilem/blob/7be4dd2a2f8bf820fc19a3af2a00600d05e4d4c7/masonry/src/widget/image.rs#L94-L97
In particular, the current layout logic entirely ignores the
FillStrat
. Effectively, theaspect-ratio
is alwaysauto
, so the only troublesome case is if we have a minimum/maximum set which never matches the given aspect ratio.This logic has recently (#571) been changed from the original Druid version.
The steps for this issue are: 1) Work out the correct layout logic. It might be that the current version is correct, at least whilst we can't set
aspect-ratio
. 2) Write a few test cases for the layout logic, and integrate them into the tests module. These could probably use screenshot tests. 3) Remove the original TODO comment.