Created
September 16, 2015 08:33
-
-
Save reportbase/adc6ed6a49c9511a26e6 to your computer and use it in GitHub Desktop.
rotate image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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