-
Notifications
You must be signed in to change notification settings - Fork 758
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
Change rotation functions back to radians #743
Comments
I agree with binoculars. I'd prefer to set the rotation in radians instead of degrees. It is more natural in mathematical calculations. |
Third that. I don't get the change really. |
I also agree. It seems like an abitrary change that a) breaks code and b) goes against the grain of the native javascript ecosystem. Can I ask why it was made? |
👍 @ericdrowell, your thoughts? |
Hi guys. Believe it or not, there was alot of requests for this. In order to lighten the KineticJS API, I wanted to support a single unit for all attrs. This also greatly simplified lots of portions of the code base. Most people seemed to want degrees for rotation. I looked at a lot of people's code on stackoverflow and other places, and I saw a lot of people using rotateDeg() or rotationDeg(). It seemed natural to make the default unit in degrees to accommodate most people's use case. There have been many other threads with people unhappy with this change. This is one of those topics where there is so much backlash that may have to go back and support both cases again :/ I'll add this to our todo list, but it's a sucky change |
Besides the fact that every library does rotation using radians by default. Your change just wasted a few hours of my time wading though my code to figure out why it would no longer work after updating the source from 4.something to 5.0.1 (Many changes, most of which make sense. Not this one) My math calculates the angle in radians in an animation. Converting to degrees only to have it turned to radians somewhere internally is a waste of CPU time. I would argue you do away with anything supporting degrees if you wish to simplify the API. |
Still messing about with this in my KineticJS based animated instrument library. Pretty pissed about this deg thing actually. Rotation data stored in databases, JSON based object definitions, everything is now wrong. Getters and setters. You should not have done this Eric. I am going to roll back to 4.5.5 till you make this right. It means changing all the new offset definitions back from {x:, y:} to [x,y] but so be it. |
I can understand the frustration that comes from having an API change from underneath you, but it's not really fair to lay into Eric so hard about this. He puts so much time into producing a free and open source library to make it easier to do cool things with the canvas, and doesn't deserve to be chastised over a decision that he made based on feedback that he received. Instead of going back to 4.5.5, it may be easier to just change your project's version of Kinetic 5.x to use radians, since Kinetic is fully open source. This would have a benefit of your code not needing changed yet again when support for radian angles are restored. After a quick look through the code, there's only one line in node.js (1145, part of _getTransform) that would seem to be the culprit. Remove the conversion from degrees to radians there, and you can then supply all of your rotations in radians. Test providing radian angle for rotation: http://jsfiddle.net/mjg6r/1/ |
You are right. I'm sorry. I had a bad weekend dealing with other library I am close to release a free Google Maps based shipsimulator game that Yes, I do think Eric is doing an amazing job. [image: Inline image 1] On Mon, Mar 17, 2014 at 3:48 PM, jfollas notifications@github.com wrote:
Regards Paul van Dinther |
Thanks @jfollas . And to re-iterate, I've heard loud and clear that a lot of people are upset about the radian to degree change. But again, I think most people are frustrated by the change because it required lots of changes to their codebase, and not because it was necessarily a bad change. I'm still keeping a close eye on this topic, don't worry. |
No, it is definitely a bad change. The only bad one really. The changes to |
For the record: I'm still in favor of the old/separate .rotation (for On Mon, Mar 17, 2014 at 12:47 AM, Paul van Dinther <notifications@github.com
|
It doesn't make sense to make the rotations in degrees since javascript accepts radians in the math functions (e.g. MATH.sin) and native canvas context rotation.
The text was updated successfully, but these errors were encountered: