godswearhats / jquery-ui-rotatable

Adds a small handle to an HTML element to allow it to be rotated
MIT License
155 stars 103 forks source link

`angle` option is in not in degrees #38

Closed vanderlee closed 7 years ago

vanderlee commented 8 years ago

The current implementation on CDN has an angle option that uses radians. Not degrees, as mentioned in the readme.

JD-Robbs commented 8 years ago

I noticed that as well and am currently converting radians and degrees back and forth. Maybe it's worth implementing something like a unit option?

godswearhats commented 8 years ago

Hmmm. I'll get this fixed and push it out as part of the March 1st 1.1 release.

mkdizajn commented 8 years ago

In my code I added the custom method for easy converting to degrees like this:

Math.degrees = function(radians) {
  return radians * 180 / Math.PI;
};

and when I get the value from angle radians with Math.degrees( ui.angle.current )

hth, cheers

godswearhats commented 8 years ago

I'm adding both degrees and radians functions to the API. Both will function like the current angle function, for their respective unit.

vanderlee commented 8 years ago

Will the angle function be changed to work according to the readme (degrees) or remain as currently implemented (radians)?

godswearhats commented 8 years ago

It will be degrees, because people don't think in radians :-)

EvilJordan commented 8 years ago

Just making sure... this was not implemented on the current release available to download, right?

godswearhats commented 7 years ago

Fixed.