May I ask canvas if you draw a turning movement?

what I"m drawing now is this

clipboard.png
http://output.jsbin.com/rosoq...


Apr.14,2021

I will not write an example of the Bezier curve. I have found a random tutorial on the Internet.

https://github.com/hujiulong/.


The

arc directly uses the arcTo function to send you a rounded rectangle path function

.
function roundRect(x, y, w, h, radius) {
    this.moveTo(x, y + h - radius[3]);
    this.arcTo(x, y, x + 1, y, radius[0]);
    this.arcTo(x + w, y, x + w, y + 1, radius[1]);
    this.arcTo(x + w, y + h, x - 1, y + h, radius[2]);
    this.arcTo(x, y + h, x, y, radius[3]);
}

roundRect.call(ctx,0,0,100,100,[10,10,10,10]) // 10 
Menu