Fix border color

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
This commit is contained in:
Emil Sjolander 2016-08-18 10:14:22 -07:00 committed by Facebook Github Bot 4
parent f83c869411
commit 805d06087b
1 changed files with 2 additions and 10 deletions

View File

@ -175,11 +175,7 @@ import com.facebook.csslayout.Spacing;
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);
@ -190,11 +186,7 @@ import com.facebook.csslayout.Spacing;
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);