@@ -240,8 +240,8 @@ protected void onDraw(Canvas canvas) {
240
240
}
241
241
242
242
final float threeRadius = mRadius * 3 + mGap ;
243
- final float shortOffset = shortPaddingBefore + mRadius ;
244
- float longOffset = longPaddingBefore + mRadius ;
243
+ final float shortOffset = shortPaddingBefore + mRadius + mPaintStroke . getStrokeWidth () / 2 ;
244
+ float longOffset = longPaddingBefore + mRadius + mPaintStroke . getStrokeWidth () / 2 ;
245
245
if (mCentered ) {
246
246
longOffset += ((longSize - longPaddingBefore - longPaddingAfter ) - (count * threeRadius - mRadius - mGap )) / 2.0f ;
247
247
}
@@ -481,7 +481,8 @@ private int measureLong(int measureSpec) {
481
481
//Calculate the width according the views count
482
482
final int count = mViewPager .getAdapter ().getCount ();
483
483
result = (int )(getPaddingLeft () + getPaddingRight ()
484
- + (count * (2 * mRadius + 1 )) + (count - 1 ) * (mRadius + mGap ));
484
+ + (count * (2 * mRadius + 1 )) + (count - 1 ) * (mRadius + mGap )
485
+ + mPaintStroke .getStrokeWidth ()); // The first circle half stroke + the last one half stroke
485
486
//Respect AT_MOST value if that was what is called for by measureSpec
486
487
if (specMode == MeasureSpec .AT_MOST ) {
487
488
result = Math .min (result , specSize );
@@ -507,7 +508,8 @@ private int measureShort(int measureSpec) {
507
508
result = specSize ;
508
509
} else {
509
510
//Measure the height
510
- result = (int )(2 * mRadius + getPaddingTop () + getPaddingBottom () + 1 );
511
+ result = (int )(2 * mRadius + getPaddingTop () + getPaddingBottom () + 1
512
+ + mPaintStroke .getStrokeWidth ()); // The first circle half stroke + the last one half stroke
511
513
//Respect AT_MOST value if that was what is called for by measureSpec
512
514
if (specMode == MeasureSpec .AT_MOST ) {
513
515
result = Math .min (result , specSize );
0 commit comments