-
Notifications
You must be signed in to change notification settings - Fork 25k
[Android] store borderColor in a non lossy way #9380
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
|
By analyzing the blame information on this pull request, we identified @andreicoman11 and @foghina to be potential reviewers. |
|
@manicakes updated the pull request. |
2 similar comments
|
@manicakes updated the pull request. |
|
@manicakes updated the pull request. |
eb51e7a to
73c8f7a
Compare
|
@manicakes updated the pull request. |
|
@andreicoman11 and @foghina looking forward to your feedback - thanks! |
|
@manicakes updated the pull request. |
4b8d3c6 to
a7121db
Compare
|
@manicakes updated the pull request. |
1 similar comment
|
@manicakes updated the pull request. |
| */ | ||
| /* package */ class ReactViewBackgroundDrawable extends Drawable { | ||
|
|
||
| private static final int DEFAULT_BORDER_COLOR = Color.BLACK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still used anywhere? Can we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in the subsequent lines, as I split out the rgb and alpha components. Hope that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I must be blind. 👓
|
Sweet, thanks for picking this up! Can you also provide a test plan for your PR? E.g. a screenshot of the sample app from #3652 running correctly. |
|
@foghina no prob! Will include test plan and update the PR shortly. |
… converting `int` to `float` is lossy. So, we first split `borderColor` into RGB and Alpha values, and store each as its own `Spacing` object.
a7121db to
9fbe19d
Compare
|
@manicakes updated the pull request. |
|
@foghina updated - thanks for the feedback. |
|
@facebook-github-bot shipit |
|
@manicakes updated the pull request. |
|
Hmm, something didn't work. Lemme try again. @facebook-github-bot shipit pls |
|
Hmmm @foghina maybe the shipit command has to be the only content in the comment for it to work? |
|
It usually works with other stuff in there as well, but yeah lemme try. |
|
@facebook-github-bot shipit |
|
Thanks for importing.If you are an FB employee go to Phabricator to review internal test results. |
|
Yay. We should make "shipit pls" a command though. |
Summary: Fix for issue facebook#3652 - Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors. So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects. *Test Plan* Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A What currently looks like this: <img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png"> Should look like this (with my fix applied): <img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png"> Closes facebook#9380 Differential Revision: D3716707 Pulled By: foghina fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b
Summary: Fix for issue facebook#3652 - Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors. So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects. *Test Plan* Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A What currently looks like this: <img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png"> Should look like this (with my fix applied): <img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png"> Closes facebook#9380 Differential Revision: D3716707 Pulled By: foghina fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b

Fix for issue #3652 -
Converting from
inttofloatis lossy for very large numbers, so storingborderColoras a singleSpacingobject (which usesfloat) was not working for certain colors.So, this pull request splits
borderColorinto alpha and RGB components, and stores each of these as their own respectiveSpacingobjects.Test Plan
Check out @cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A
What currently looks like this:
Should look like this (with my fix applied):