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