@@ -95,10 +95,14 @@ 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 ) {
99
- drawRoundedBackgroundWithBorders (canvas );
100
- } else {
98
+ updatePathEffect ();
99
+ boolean roundedBorders = mBorderCornerRadii != null ||
100
+ (!CSSConstants .isUndefined (mBorderRadius ) && mBorderRadius > 0 );
101
+
102
+ if ((mBorderStyle == null || mBorderStyle == BorderStyle .SOLID ) && !roundedBorders ) {
101
103
drawRectangularBackgroundWithBorders (canvas );
104
+ } else {
105
+ drawRoundedBackgroundWithBorders (canvas );
102
106
}
103
107
}
104
108
@@ -231,7 +235,6 @@ private void drawRoundedBackgroundWithBorders(Canvas canvas) {
231
235
mPaint .setColor (ColorUtil .multiplyColorAlpha (borderColor , mAlpha ));
232
236
mPaint .setStyle (Paint .Style .STROKE );
233
237
mPaint .setStrokeWidth (fullBorderWidth );
234
- mPaint .setPathEffect (mPathEffectForBorderStyle );
235
238
canvas .drawPath (mPathForBorderRadius , mPaint );
236
239
}
237
240
}
@@ -298,10 +301,17 @@ private void updatePath() {
298
301
bottomLeftRadius + extraRadiusForOutline
299
302
},
300
303
Path .Direction .CW );
304
+ }
301
305
306
+ /**
307
+ * Set type of border
308
+ */
309
+ private void updatePathEffect () {
302
310
mPathEffectForBorderStyle = mBorderStyle != null
303
311
? mBorderStyle .getPathEffect (getFullBorderWidth ())
304
312
: null ;
313
+
314
+ mPaint .setPathEffect (mPathEffectForBorderStyle );
305
315
}
306
316
307
317
/**
0 commit comments