mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-06 22:38:37 +08:00
Revert "fix border style without borderRadius"
Summary:
Subj broke ObjC snapshot tests
This reverts commit 58876d5a03.
Closes https://github.com/facebook/react-native/pull/7303
Differential Revision: D3243670
fb-gh-sync-id: acef6bc7a50b0fa7dc112b88407644e8226d6f85
fbshipit-source-id: acef6bc7a50b0fa7dc112b88407644e8226d6f85
This commit is contained in:
committed by
Facebook Github Bot 5
parent
169cfb5a52
commit
0c590b325d
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user