Created
April 2, 2015 23:45
-
-
Save rezoner/65f8313b156fbd48d467 to your computer and use it in GitHub Desktop.
PLAYGROUND.Layer plugin
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
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