I am working on a custom view in which a Circle is to be drawn around the view clicked within the screen rectangular bounds. Below is the piece of code written.
@Override
protected void onDraw(final Canvas canvas) {
super.onDraw(canvas);
targetPaintOuterThinCircle.setStyle(Paint.Style.STROKE);
targetPaintOuterThinCircle.setStrokeWidth(thinOuterCircleWidth);
targetPaintOuterThinCircle.setColor(PRIMARY_GREEN);
targetPaintOuterThinCircle.setAntiAlias(true);
targetOuterThinCirclePath.reset();
targetOuterThinCirclePath.addCircle(targetX, targetY, RADIUS_SIZE_OUTER_THIN_CIRCLE, Path.Direction.CW);
targetOuterThinCirclePath.op(screenRectPath, Path.Op.INTERSECT);
canvas.drawPath(targetOuterThinCirclePath, targetPaintOuterThinCircle);
}
My output comes out like this.
Expected output - don't want the intersecting line at the bottom.
I tried using the addArc method but on doing the Path.Op.Intersect
operation with rectangular bounds it adds the intersect lines as well.