Cocoa Port:
- Fix bug in GetNormalPointFromTransformedPoint() function where the angleDegrees parameter was actually in radians. It's now in degrees, as intended.
This commit is contained in:
parent
5f2dd3e4c2
commit
2212f36cb0
|
@ -507,6 +507,7 @@ double GetMaxScalarInBounds(double normalBoundsWidth, double normalBoundsHeight,
|
|||
********************************************************************************************/
|
||||
NSPoint GetNormalPointFromTransformedPoint(NSPoint transformedPt, NSSize normalBounds, NSSize transformBounds, double scalar, double angleDegrees)
|
||||
{
|
||||
double angleRadians = angleDegrees * (M_PI/180.0);
|
||||
double transformedX = 0.0;
|
||||
double transformedY = 0.0;
|
||||
|
||||
|
@ -556,7 +557,7 @@ NSPoint GetNormalPointFromTransformedPoint(NSPoint transformedPt, NSSize normalB
|
|||
// Get the normalized angle and use it to rotate about the origin.
|
||||
// Then do polar-rect conversion and translate back to transformed coordinates
|
||||
// with a 0 degree rotation.
|
||||
normalizedAngle = theta - angleDegrees;
|
||||
normalizedAngle = theta - angleRadians;
|
||||
normalizedX = (r * cos(normalizedAngle)) + (normalBounds.width * scalar / 2.0);
|
||||
normalizedY = (r * sin(normalizedAngle)) + (normalBounds.height * scalar / 2.0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue