Closed danzen closed 3 years ago
This is an example. The CreateJS code does have a closePath. And it is weird, when I use a "round" setting for the joints then it goes round. When I do a bevel it does bevels on all the rest but a different bevel on the start and stop joint. The difference is small but it is there. It is the same incorrect bevel as when miter is used. So, looking into it further.
I see... closePath just draws a straight line between the ends so that is why it looks like a bevel. So for the Poly, I just went right around to the first point again and we get the desired end.
In PolyStar:
ctx.moveTo(x+Math.cos(angle)*radius, y+Math.sin(angle)*radius);
for (var i=0; i<sides+1; i++) {
angle += a;
if (ps != 1) {
ctx.lineTo(x+Math.cos(angle)*radius*ps, y+Math.sin(angle)*radius*ps);
if (i==sides) break;
}
angle += a;
ctx.lineTo(x+Math.cos(angle)*radius, y+Math.sin(angle)*radius);
}
ctx.closePath();
Added the change to the main branch. https://github.com/CreateJS/EaselJS/commit/9cb3b4bd7e1d49e285f65a5dd04cc56ebb3a940f Also, just thought to test with reduced alpha line color and it works fine.
Just noticed that the tip of a drawPoly is cut off a little. I have had that happen when the path is not closed at the end. Just putting this here as a reminder to look at later!