-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the point of setPosition #4
Comments
setPosition
ah yes - most people would probably not need it, but you can use it to improve performance for special situations. For example if you have a complex rendering on a layer, but just need to move it around, you could use setPosition() to physically move the canvas element as opposed to constantly re rendering. Alternatively, you could copy the canvas, and then re render the canvas pixels at different locations. |
you do have a point however, as most folks would probably never use it |
I think the situation you mentioned is sort of related to what I want. Currently, I use Many thanks |
you are absolutely correct, setPosition() isn't actually moving the dom element. Must have been something I was thinking about but missed. setPosition() should also do: this.viewport.container.style.marginLeft = x; or something similar |
Currently, I can not come up with a way to make Correct me If I understand things more wrong, my knowledge of canvas is limited |
Just alter the render function and put layer.x and layer.y for the two 0,0 in drawImage :) |
@marstave |
I can not identify any meaning logic relation to
setPosition
Is there anything yet to be implemented?
The text was updated successfully, but these errors were encountered: