-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Proposal: PixelRatio.pixel() #5073
Labels
Resolution: Locked
This issue was locked by the bot.
Comments
Hey corbt, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
I like this idea, let's move it into a pull request! 🚀 |
Cool, working on it. |
Closed
ghost
pushed a commit
that referenced
this issue
Jan 15, 2016
Summary: This implements #5073. It adds a static method `PixelRatio.pixel()` which returns the smallest drawable line width, primarily for use in styles. It also updates the example apps to use the new function. Closes #5076 Reviewed By: svcscm Differential Revision: D2799849 Pulled By: nicklockwood fb-gh-sync-id: b83a77790601fe882affbf65531114e7c5cf4bdf
christopherdro
pushed a commit
to wildlifela/react-native
that referenced
this issue
Jan 20, 2016
Summary: This implements facebook#5073. It adds a static method `PixelRatio.pixel()` which returns the smallest drawable line width, primarily for use in styles. It also updates the example apps to use the new function. Closes facebook#5076 Reviewed By: svcscm Differential Revision: D2799849 Pulled By: nicklockwood fb-gh-sync-id: b83a77790601fe882affbf65531114e7c5cf4bdf
rozele
referenced
this issue
in microsoft/react-native-windows
May 25, 2016
Summary: This implements #5073. It adds a static method `PixelRatio.pixel()` which returns the smallest drawable line width, primarily for use in styles. It also updates the example apps to use the new function. Closes facebook/react-native#5076 Reviewed By: svcscm Differential Revision: D2799849 Pulled By: nicklockwood fb-gh-sync-id: b83a77790601fe882affbf65531114e7c5cf4bdf
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It seems like a fairly common pattern to want a line that's the thinnest possible width. Currently this can be accomplished with a style something like:
This works fine, but without reading the documentation of
PixelRatio
it's not obvious what's going on.I propose adding a function
PixelRatio.pixel
(or alternativelyPixelRatio.smallestPixel
) that simply returns the inverse ofPixelRatio.get
. This would make it immediately clear what a style using it is trying to accomplish, even to someone who hasn't read the PixelRatio documentation.I'm happy to implement and document this if there's general agreement that it's a good idea.
The text was updated successfully, but these errors were encountered: