Always resolvable Val
alternative with no Auto
variant
#9688
Labels
A-UI
Graphical user interfaces, styles, layouts, and widgets
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
Val's Auto variant doesn't make sense for certain Style fields, such as the gap properties. In those cases internally
Auto
just gets mapped to Taffy's LengthPercentage::Points(0.)This might not seem that significant but it's been bothering me intensely the last year. It's never ideal to have multiple representations mapping to the same underlying value like this.
What solution would you like?
My proposal is PR #8096 which I submitted a while ago. It needs an update to support the recent changes to
Val
, and the macro that implements some of the helper functions could be improved maybe. There wouldn't be any major changes though, so reviews won't be wasted.Making
Margin
,Padding
andBorder
into separate types might be controversial. I'm not bothered if we have a genericUiRect<T>
orUiRect
(withVal
edge values) andNumRect
(withNum
s) instead. The only important change is adding the always resolvable type.What alternative(s) have you considered?
There are some discussions at: #7656, #7969, #7710, #7569.
The text was updated successfully, but these errors were encountered: