-
Notifications
You must be signed in to change notification settings - Fork 109
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
Rename Points
/points
to Length
/length
in many APIs
#459
Conversation
Ah, this already has conflicts. Given the number of changes (although many are in generated files), I’ll wait for a maintainer to approve the spirit of the change and say they’re ready to merge before I rebase and fix conflicts. |
I agree with moving away from |
I'm definitely in agreement that "points" is a poor name, and that it ought to be renamed. "length" seems reasonable. My only question is whether we might be better off naming things "px" (or "Pixels") where that is explicitly documented to be a "logical pixel" (as px is in CSS). My understanding is that the unit will be a "px" regardless of whether it is named that. "Length" does make sense in that it fits with "LengthPercentage" and "LengthPercentage" which we already have in the codebase. I'm just not sure that people will intuitively understand it in the way that they will know what a pixel is. Thoughts? |
I think |
And |
It's not only CSS that deals with logical pixels: anything that does supports hidpi will have a similar concept. I'm a little concerned that
I was thinking that having |
I really like the On the naming topic, I definitely think that |
Alright @SimonSapin we've come to a consensus that this is a path we'd like to pursue; can you please rebase this or otherwise resolve merge conflicts? :) |
@alice-i-cecile I do think that these docs:
are wrong if we have But yes, happy to see this merged once conflicts are resolved :) |
⚠️ This is a fairly disruptive breaking changes, although the fix for users is mostly search-and-replace. The old name for this one-dimensional length: * Suggests PostScript points, but is documented as an abstract unit: “Users of Taffy may define what they correspond to in their application (pixels, logical pixels, mm, etc) as they see fit.” * Is spelled similar to the two-dimensional `Point` though its meaning is unrelated. * In CSS syntax, `1px = 0.75pt` but the former is much more commonly used. When [parsing CSS into a `Style`](DioxusLabs#440) we’ll probably want the default mapping to be `1px` => 1f32 abstract unit, so naming the abstract unit "points" would be confusing.
Rebased!
Right, I also thought of "absolute" as an alternative name for that reason. But then it wouldn’t say at all that it’s a one-dimensional measure of space. It would rely entirely on context for that. |
Objective
The old name for this one-dimensional length:
Suggests PostScript points, but is documented as an abstract unit: “Users of Taffy may define what they correspond to in their application (pixels, logical pixels, mm, etc) as they see fit.”
Is spelled similar to the two-dimensional
Point
though its meaning is unrelated.In CSS syntax,
1px = 0.75pt
but the former is much more commonly used. When parsing CSS into aStyle
we’ll probably want the default mapping to be1px
=> 1f32 abstract unit, so naming the abstract unit "points" would be confusing.Context
This was discussed in #440 (comment):
Feedback wanted
Are the benefits listed above worth the disruption to existing users?