From 0c590b325d4d8acbfefe5012c802071ba180ef39 Mon Sep 17 00:00:00 2001 From: Konstantin Raev Date: Fri, 29 Apr 2016 16:36:36 -0700 Subject: [PATCH] Revert "fix border style without borderRadius" Summary: Subj broke ObjC snapshot tests This reverts commit 58876d5a03b2c709b83ae212010b623d1c51c9cf. Closes https://github.com/facebook/react-native/pull/7303 Differential Revision: D3243670 fb-gh-sync-id: acef6bc7a50b0fa7dc112b88407644e8226d6f85 fbshipit-source-id: acef6bc7a50b0fa7dc112b88407644e8226d6f85 --- Examples/UIExplorer/ViewExample.js | 1 + .../view/ReactViewBackgroundDrawable.java | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Examples/UIExplorer/ViewExample.js b/Examples/UIExplorer/ViewExample.js index c5cb7cae7..4be867b27 100644 --- a/Examples/UIExplorer/ViewExample.js +++ b/Examples/UIExplorer/ViewExample.js @@ -46,6 +46,7 @@ var ViewBorderStyleExample = React.createClass({ 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 7aef44b1b..fd8961cb8 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 @@ -95,14 +95,10 @@ import com.facebook.csslayout.Spacing; @Override public void draw(Canvas canvas) { - updatePathEffect(); - boolean roundedBorders = mBorderCornerRadii != null || - (!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0); - - if ((mBorderStyle == null || mBorderStyle == BorderStyle.SOLID) && !roundedBorders) { - drawRectangularBackgroundWithBorders(canvas); - } else { + if ((!CSSConstants.isUndefined(mBorderRadius) && mBorderRadius > 0) || mBorderCornerRadii != null) { drawRoundedBackgroundWithBorders(canvas); + } else { + drawRectangularBackgroundWithBorders(canvas); } } @@ -235,6 +231,7 @@ import com.facebook.csslayout.Spacing; mPaint.setColor(ColorUtil.multiplyColorAlpha(borderColor, mAlpha)); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(fullBorderWidth); + mPaint.setPathEffect(mPathEffectForBorderStyle); canvas.drawPath(mPathForBorderRadius, mPaint); } } @@ -301,17 +298,10 @@ import com.facebook.csslayout.Spacing; bottomLeftRadius + extraRadiusForOutline }, Path.Direction.CW); - } - /** - * Set type of border - */ - private void updatePathEffect() { mPathEffectForBorderStyle = mBorderStyle != null ? mBorderStyle.getPathEffect(getFullBorderWidth()) : null; - - mPaint.setPathEffect(mPathEffectForBorderStyle); } /**