File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
ReactAndroid/src/main/java/com/facebook/react/views/view Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ var ViewBorderStyleExample = React.createClass({
46
46
< View >
47
47
< View style = { {
48
48
borderWidth : 1 ,
49
- borderRadius : 5 ,
50
49
borderStyle : this . state . showBorder ? 'dashed' : null ,
51
50
padding : 5
52
51
} } >
Original file line number Diff line number Diff line change @@ -95,7 +95,9 @@ private static enum BorderStyle {
95
95
96
96
@ Override
97
97
public void draw (Canvas canvas ) {
98
- if ((!CSSConstants .isUndefined (mBorderRadius ) && mBorderRadius > 0 ) || mBorderCornerRadii != null ) {
98
+ updatePathEffectForBorderStyle ();
99
+ if ((!CSSConstants .isUndefined (mBorderRadius ) && mBorderRadius > 0 ) || mBorderCornerRadii != null ||
100
+ !(mBorderStyle == null || mBorderStyle == BorderStyle .SOLID )) {
99
101
drawRoundedBackgroundWithBorders (canvas );
100
102
} else {
101
103
drawRectangularBackgroundWithBorders (canvas );
@@ -298,7 +300,9 @@ private void updatePath() {
298
300
bottomLeftRadius + extraRadiusForOutline
299
301
},
300
302
Path .Direction .CW );
303
+ }
301
304
305
+ private void updatePathEffectForBorderStyle () {
302
306
mPathEffectForBorderStyle = mBorderStyle != null
303
307
? mBorderStyle .getPathEffect (getFullBorderWidth ())
304
308
: null ;
@@ -332,6 +336,8 @@ private void drawRectangularBackgroundWithBorders(Canvas canvas) {
332
336
if (getBorderWidth (Spacing .LEFT ) > 0 || getBorderWidth (Spacing .TOP ) > 0 ||
333
337
getBorderWidth (Spacing .RIGHT ) > 0 || getBorderWidth (Spacing .BOTTOM ) > 0 ) {
334
338
339
+ mPaint .setPathEffect (mPathEffectForBorderStyle );
340
+
335
341
int borderLeft = getBorderWidth (Spacing .LEFT );
336
342
int borderTop = getBorderWidth (Spacing .TOP );
337
343
int borderRight = getBorderWidth (Spacing .RIGHT );
You can’t perform that action at this time.
0 commit comments