From 805d06087b8a4bbaa2144f67cfeedde0d306040f Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 18 Aug 2016 10:14:22 -0700 Subject: [PATCH] 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 --- .../views/view/ReactViewBackgroundDrawable.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java index f90bb3847..de9dcbc7f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java @@ -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);