我使用addArc()创建了半圆,但弧与弧之间存在奇怪的差距。矩形如下图所示。如何去除弧周围的空隙。
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);