Skip to content

Commit 805d060

Browse files
Emil SjolanderFacebook Github Bot 4
authored andcommitted
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
1 parent f83c869 commit 805d060

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,7 @@ public void setBorderColor(int position, float rgb, float alpha) {
175175
private void setBorderRGB(int position, float rgb) {
176176
// set RGB component
177177
if (mBorderRGB == null) {
178-
mBorderRGB = new Spacing();
179-
mBorderRGB.set(Spacing.LEFT, DEFAULT_BORDER_RGB);
180-
mBorderRGB.set(Spacing.TOP, DEFAULT_BORDER_RGB);
181-
mBorderRGB.set(Spacing.RIGHT, DEFAULT_BORDER_RGB);
182-
mBorderRGB.set(Spacing.BOTTOM, DEFAULT_BORDER_RGB);
178+
mBorderRGB = new Spacing(DEFAULT_BORDER_RGB);
183179
}
184180
if (!FloatUtil.floatsEqual(mBorderRGB.getRaw(position), rgb)) {
185181
mBorderRGB.set(position, rgb);
@@ -190,11 +186,7 @@ private void setBorderRGB(int position, float rgb) {
190186
private void setBorderAlpha(int position, float alpha) {
191187
// set Alpha component
192188
if (mBorderAlpha == null) {
193-
mBorderAlpha = new Spacing();
194-
mBorderAlpha.set(Spacing.LEFT, DEFAULT_BORDER_ALPHA);
195-
mBorderAlpha.set(Spacing.TOP, DEFAULT_BORDER_ALPHA);
196-
mBorderAlpha.set(Spacing.RIGHT, DEFAULT_BORDER_ALPHA);
197-
mBorderAlpha.set(Spacing.BOTTOM, DEFAULT_BORDER_ALPHA);
189+
mBorderAlpha = new Spacing(DEFAULT_BORDER_ALPHA);
198190
}
199191
if (!FloatUtil.floatsEqual(mBorderAlpha.getRaw(position), alpha)) {
200192
mBorderAlpha.set(position, alpha);

0 commit comments

Comments
 (0)