Skip to content

Commit

Permalink
Fix border color
Browse files Browse the repository at this point in the history
Summary: Border colors broke with recent change to default values in csslayout Spacing. This is a quick fix until we move react-native borders away from using Spacing.java which is a hack in the first place.

Reviewed By: lexs

Differential Revision: D3735435

fbshipit-source-id: 747c85798cb02e1a5139de038eb26b64ac4c5bf3
  • Loading branch information
Emil Sjolander authored and Facebook Github Bot 4 committed Aug 18, 2016
1 parent f83c869 commit 805d060
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ public void setBorderColor(int position, float rgb, float alpha) {
private void setBorderRGB(int position, float rgb) {
// set RGB component
if (mBorderRGB == null) {
mBorderRGB = new Spacing();
mBorderRGB.set(Spacing.LEFT, DEFAULT_BORDER_RGB);
mBorderRGB.set(Spacing.TOP, DEFAULT_BORDER_RGB);
mBorderRGB.set(Spacing.RIGHT, DEFAULT_BORDER_RGB);
mBorderRGB.set(Spacing.BOTTOM, DEFAULT_BORDER_RGB);
mBorderRGB = new Spacing(DEFAULT_BORDER_RGB);
}
if (!FloatUtil.floatsEqual(mBorderRGB.getRaw(position), rgb)) {
mBorderRGB.set(position, rgb);
Expand All @@ -190,11 +186,7 @@ private void setBorderRGB(int position, float rgb) {
private void setBorderAlpha(int position, float alpha) {
// set Alpha component
if (mBorderAlpha == null) {
mBorderAlpha = new Spacing();
mBorderAlpha.set(Spacing.LEFT, DEFAULT_BORDER_ALPHA);
mBorderAlpha.set(Spacing.TOP, DEFAULT_BORDER_ALPHA);
mBorderAlpha.set(Spacing.RIGHT, DEFAULT_BORDER_ALPHA);
mBorderAlpha.set(Spacing.BOTTOM, DEFAULT_BORDER_ALPHA);
mBorderAlpha = new Spacing(DEFAULT_BORDER_ALPHA);
}
if (!FloatUtil.floatsEqual(mBorderAlpha.getRaw(position), alpha)) {
mBorderAlpha.set(position, alpha);
Expand Down

0 comments on commit 805d060

Please sign in to comment.