Permalink
Browse files

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
  • Loading branch information...
1 parent f83c869 commit 805d06087b8a4bbaa2144f67cfeedde0d306040f @emilsjolander emilsjolander committed with Facebook Github Bot 4 Aug 18, 2016
@@ -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);
@@ -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);

0 comments on commit 805d060

Please sign in to comment.