Last active
December 31, 2015 05:39
-
-
Save david-hodgetts/7942678 to your computer and use it in GitHub Desktop.
test code for project exquis -> https://github.com/gongfuio/Exquis
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
// test code for project exquis -> https://github.com/gongfuio/Exquis | |
// setup | |
this.TO_RADIANS = Math.PI/180; | |
this.buffer = document.createElement('canvas'); | |
this.buffer.width = context.canvas.width; | |
this.buffer.height = context.canvas.height; | |
this.bufferCtx = this.buffer.getContext("2d"); | |
this.rotation = 0; | |
// draw | |
this.bufferCtx.drawImage(context.canvas, 0, 0, context.canvas.width, context.canvas.height); | |
context.save(); | |
context.rotate(this.rotation * this.TO_RADIANS); | |
this.rotation += 1; | |
context.drawImage(this.buffer, 0,0, context.canvas.width, context.canvas.height); | |
context.restore(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment