Skip to content

Instantly share code, notes, and snippets.

@rezoner
Created April 2, 2015 23:45
Show Gist options
  • Save rezoner/65f8313b156fbd48d467 to your computer and use it in GitHub Desktop.
Save rezoner/65f8313b156fbd48d467 to your computer and use it in GitHub Desktop.
PLAYGROUND.Layer plugin
PLAYGROUND.Layer = {
plugin: true,
app: {
create: function(app, data) {
app.layer = cq().appendTo(app.container);
},
resize: function(app, data) {
var layer = app.layer;
layer.width = app.width;
layer.height = app.height;
layer.canvas.style.transformOrigin = "0 0";
layer.canvas.style.transform = "translate(" + app.offsetX + "px," + app.offsetY + "px) scale(" + app.scale + ", " + app.scale + ")";
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment