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
getScaleX/getScaleY return 1 if scale is applied through a matrix #162
Comments
No, this is quite unexpected. Thanks for filing, this is a bug. |
👍 that may be something I can tackle now that I’m face down in these things. |
That would be greatly appreciated |
Making some progress, though the getters/setters and _prop/prop methods are a bit confusing to understand. What is the difference and purpose behind Also, I don’t think I understand why the matrix getter (https://github.com/uxebu/bonsai/blob/master/src/runner/display_object.js#L73-L87) clones the |
It’s implicit: Everything prefixed with “_” is considered private data, e.g. to store values returned by setters/getters. Unprefixed properties are considered public and can be updated through the The problem with the current accessor based code is that we are not really able to share code between different types. We want to replace it with a system as in sproutcore 1, where each attribute get/set operations will look for This will allow for better code sharing and cheaper lookups, since most getter/setter pairs we have in place really only need the setter.
The commit in the “old” (pre-public) repo and ticket there explain it. Unfortunately, the code misses an explanation. The reason is simple: If the programmer sets scale to |
I know about the js convention to mark things as private with a prefixed
I assume this means a rewrite is on the roadmap eventually.
It’s still out in the bikeshed? ;) Saw you had another commit with a comment. That helps a lot, thank you. |
Yes, these are weird. I tried a different, simpler implementation today, but didn’t commit, since I wasn’t sure whether it would work so well with rotation. I need to try and add other testcases, if needed |
Copy that. I am burying myself in matrices right now so I could probably provide some test cases. |
First issue, assigning a scale via the matrix attribute, then getting the scale doesn’t return the applied scale.
Additionally
Is this expected?
The text was updated successfully, but these errors were encountered: