js canvas roate
snippet in javascript

js canvas roate

user476


//ctx.rotate() will rotate the entire drawing canvas
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.rotate(20 * Math.PI / 180);
ctx.fillRect(50, 20, 100, 50);