Better image aspect ratio handling #79
Labels
C-layout
relates to the cuicui_layout crate specifically
C-sprite
relates to the cuicui_layout_bevy_sprite crate specifically
T-enhancement
New feature or request
One interesting property of bevy-lunex is that it avoids at all costs breaking image aspect ratio.
I'm not sure how it does it, but it's something cuicui_layout is bad at keeping.
Currently, only images spawned as leaf nodes preserve aspect ratio, when one of the two axis is marked as
LeafRule::Content
, it will delegate to thecontent_sized
module the computation of this axis, when constraint on the other is declared.Current cuicui_layout limitations:
ScalingMode
)I'm really not in favor of adding a newRule
type for this. I want to make the logic for layouting as minimalist as possible, to make it possible to reason about it.I think it's something that could be solved in a downstream crate (cuicui_layout_bevy_ui
or/andcuicui_layout_bevy_sprite
)^^ I changed opinion on this. After writing a tutorial on
cuicui_layout
, I'm convinced that an explicit way to keep aspect ratio is ideal. It enables an homogeneous interpretation (and source!) as to how a specific node's size is computed. I think a new set of rules is the best approach here.Rule
s. #97The text was updated successfully, but these errors were encountered: