Closed angleneo closed 2 years ago
I try to use ctx.rotate , but it not work.
fillText(ctx, text = '', color = '#000', x = 0, y = 0, bold = '', rotate ) { if (text) { ctx.fillStyle = color ctx.font = ${bold} ${size}px sans-serif ctx.fillText(text, x, y) ctx.rotate((rotate * Math.PI) / 180) } }
${bold} ${size}px sans-serif
If you want to rotate the text, I think you need to call .rotate() first before .fillText()
.rotate()
.fillText()
I try to use ctx.rotate , but it not work.
fillText(ctx, text = '', color = '#000', x = 0, y = 0, bold = '', rotate ) { if (text) { ctx.fillStyle = color ctx.font =
${bold} ${size}px sans-serif
ctx.fillText(text, x, y) ctx.rotate((rotate * Math.PI) / 180) } }