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
This commit is contained in:
Konstantin Raev 2016-04-29 16:36:36 -07:00 committed by Facebook Github Bot 5
parent 169cfb5a52
commit 0c590b325d
2 changed files with 5 additions and 14 deletions

View File

@ -46,6 +46,7 @@ var ViewBorderStyleExample = React.createClass({
<View>
<View style={{
borderWidth: 1,
borderRadius: 5,
borderStyle: this.state.showBorder ? 'dashed' : null,
padding: 5
}}>

View File

@ -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);
}
/**