Skip to content

Instantly share code, notes, and snippets.

@reportbase
Created September 16, 2015 08:33
Show Gist options
  • Save reportbase/adc6ed6a49c9511a26e6 to your computer and use it in GitHub Desktop.
Save reportbase/adc6ed6a49c9511a26e6 to your computer and use it in GitHub Desktop.
rotate image
var rotate_image_panel = function(degrees)
{
this.draw = function(context, rect, user)
{
//http://jsfiddle.net/reportbase/z0v2w3ww/
context.save();
context.translate(rect.width/2,rect.height/2);
context.rotate(degrees*Math.PI/180);
context.drawImage(image,-image.width/2,-image.width/2);
context.restore();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment