I am trying to use Canvas.drawLine
method to draw a polygon
Here's the code that I am using
Canvas canvas = new Canvas(cache);
Paint paint = new Paint();
paint.setStrokeWidth(16);
paint.setColor(this.currentDrawing.getColor());
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
systemCanvas.drawBitmap(cache, 0, 0, paint);
paint.setStrokeCap(Cap.ROOUND);
canvas.drawLine(from.getLeft(), from.getTop(), to.getLeft(), to.getTop(), paint);
And this is the output that I am getting:
Notice the way the lines render, they break on the round shapes and don't join smoothly. I understand why is it happening but I don't know how to make it smooth and consistent.
Any help is appreciated.