addArc() using path default margin/padding
<p>I have created semi-circle using addArc() but there is strange gap between arc &amp; rectangle as shown in image below. How to remove that gap around arc.</p>

<p><strong>Here is my output image link.</strong>
<a href="https://i.stack.imgur.com/Owos0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Owos0.jpg" alt="enter image description here"></a></p>

<pre class="lang-java prettyprint-override"><code>int saveCount = canvas.saveLayer(0, 0, getWidth(), getHeight(), null, Canvas.ALL_SAVE_FLAG);
    super.dispatchDraw(canvas);

    paint.setXfermode(pdMode);
    paint.setStrokeWidth(0);
    path.reset();
    path.setFillType(Path.FillType.INVERSE_WINDING);
    //path.moveTo(0, getHeight() - 100);
    int h = (getMeasuredHeight() / 2) - (getMeasuredHeight() /2) - 100;
    path.addArc(new RectF(50, h, getMeasuredWidth()-50, getMeasuredHeight()-50), 0, 180);
    path.close();


    canvas.drawPath(path, paint);

    canvas.restoreToCount(saveCount);
    paint.setXfermode(null);
</code></pre>