@@ -95,7 +95,8 @@ 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
+ if ((!CSSConstants .isUndefined (mBorderRadius ) && mBorderRadius > 0 ) || mBorderCornerRadii != null ||
99
+ !(mBorderStyle == null || mBorderStyle == BorderStyle .SOLID )) {
99
100
drawRoundedBackgroundWithBorders (canvas );
100
101
} else {
101
102
drawRectangularBackgroundWithBorders (canvas );
@@ -299,6 +300,10 @@ private void updatePath() {
299
300
},
300
301
Path .Direction .CW );
301
302
303
+ updatePathEffectForBorderStyle ();
304
+ }
305
+
306
+ private void updatePathEffectForBorderStyle () {
302
307
mPathEffectForBorderStyle = mBorderStyle != null
303
308
? mBorderStyle .getPathEffect (getFullBorderWidth ())
304
309
: null ;
@@ -322,6 +327,7 @@ private int getFullBorderColor() {
322
327
}
323
328
324
329
private void drawRectangularBackgroundWithBorders (Canvas canvas ) {
330
+ updatePathEffectForBorderStyle ();
325
331
int useColor = ColorUtil .multiplyColorAlpha (mColor , mAlpha );
326
332
if ((useColor >>> 24 ) != 0 ) { // color is not transparent
327
333
mPaint .setColor (useColor );
@@ -332,6 +338,8 @@ private void drawRectangularBackgroundWithBorders(Canvas canvas) {
332
338
if (getBorderWidth (Spacing .LEFT ) > 0 || getBorderWidth (Spacing .TOP ) > 0 ||
333
339
getBorderWidth (Spacing .RIGHT ) > 0 || getBorderWidth (Spacing .BOTTOM ) > 0 ) {
334
340
341
+ mPaint .setPathEffect (mPathEffectForBorderStyle );
342
+
335
343
int borderLeft = getBorderWidth (Spacing .LEFT );
336
344
int borderTop = getBorderWidth (Spacing .TOP );
337
345
int borderRight = getBorderWidth (Spacing .RIGHT );
0 commit comments