-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
impl From<f32> and From<i32> for Val #20517
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
Conversation
Related to #15937. |
I don't think, this is a good idea for the reasons mentioned in #15937 (comment) And besides, if we have helper functions, four characters more for writing And besides (I already mentioned this in the issue), how should users know, that this is pixels? We still don't have a good place for documentation and just assuming, everyone knows, that a unitless value will be in pixels, will lead to confusion. Picture yourself, not knowing anything about Bevy and you're reading code where a width of 100 is specified. You will need to google this or just assume it's going to be in pixels without being sure. So I'm definitely for closing this and adding the trait someone proposed to the other PR (#20518 (comment)). |
IIRC the problem with the I don't see |
No, you can't have unitless values in CSS (except for 0), you always have to specify it |
Oh yeah you're right, it's been years since I've done any css. Most other layout models like figma allow you to ellide the units though. |
I don't think making |
Objective
impl
From<f32>
andFrom<i32>
forVal
Solution
impl
From<f32>
andFrom<i32>
forVal