Skip to content
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

applying the stack overflow hack to main library #566

Closed
wants to merge 1 commit into from

Conversation

aniruddha-loya
Copy link
Contributor

A small hack that I created to override the derived transform based on custom requirement for this question: http://stackoverflow.com/q/18273022/853872
and made the revisions to version 4.6.0 which is uploaded here: http://aplus1games.com/js/kinetic-v4.6.0.js
Line numbers in this file: 8031 - 8034 (very specific to image drawing)
but this patch should be applicable to all shapes

@ericdrowell
Copy link
Owner

I don't think this is an elegant solution. As pointed out by the person asking the question, it would make sense to have a way to apply a transform to a node, such as shape.setTransform(). I'll add this to my todo list, thanks!

@aniruddha-loya
Copy link
Contributor Author

Thanks!
there already is an _setTransform() method, but using that does not affect the rendering because it is not considered as part of it and is overridden. So a method to setTransform() will essentially have to do something similar to suggested solution in order to override draw method, or there is an option to set individual properties like setAbsolutePosition(), setAbsoluteRotation(), etc. so that the end effect is same. Looking forward to see your update on this in future version :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants