(-rotationAngle): Correct the sign of the angle and wrap it so that it's always >=0 and <=360.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18862 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2004-03-22 01:06:37 +00:00
parent 5202d04b05
commit 977599e82a
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2004-03-22 02:00 Georg Fleischmann <georg@vhf.de>
* Source/NSAffineTransform.m (-rotationAngle): Correct the sign of
the angle and wrap it so that it's always >=0 and <=360.
2004-03-22 01:13 Alexander Malmberg <alexander@malmberg.org>
* Source/NSLayoutManager.m

View file

@ -435,9 +435,10 @@ static NSAffineTransformStruct identityTransform = {
- (float) rotationAngle
{
/* FIXME - this is not correct in general! */
float rotationAngle = atan2(C, A);
float rotationAngle = atan2(-C, A);
rotationAngle *= 180.0 / pi;
if (rotationAngle < 0.0)
rotationAngle += 360.0;
return rotationAngle;
}