Skip to content
Advertisement

Only draw closePath() line

So I’m trying to draw a polygon using the arc function. I know there are better ways to draw a polygon but I’m going to use this functionality to plot points within later on.

I’ve got the shape drawn no problem, however, the arc path is visible so I was wondering if there is just a simple way to remove it from the path. I’ve tried a couple of things and I haven’t found anything online.

Failing this, would there be a way to store the current position before the arc is drawn and use this position to create the line from the endpoint instead?

JavaScript

Current result

Edit: Someone recommended another post about transparency, I don’t see anything in that post about separating closePath from the actual path itself. Maybe I missed something since that post is fairly long.

Advertisement

Answer

What about this modified approach?

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement