Skip to content

Instantly share code, notes, and snippets.

@david-hodgetts
Last active December 31, 2015 05:39
Show Gist options
  • Save david-hodgetts/7942678 to your computer and use it in GitHub Desktop.
Save david-hodgetts/7942678 to your computer and use it in GitHub Desktop.
test code for project exquis -> https://github.com/gongfuio/Exquis
// 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