DEV Community

Zevan Rosser
Zevan Rosser

Posted on

Smooth Bezier on Canvas

Being able to draw smooth lines that connect arbitrary points is something that I find myself needing very frequently. This is a port of an old old snippet of mine that does just that. By averaging control points of a quadratic bezier curve we ensure that our resulting Bezier curves are always smooth.

It would be very cool if html5 canvas implemented the Catmull Rom Spline but it unfortunately does not. The wonderful Raphael library used to have support for it.

See more stuff like this over @ Snippet Zone

Top comments (0)