bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix, NSAffineTransform (Text Rotation)


From: Georg Fleischmann
Subject: Fix, NSAffineTransform (Text Rotation)
Date: Sun, 14 Mar 2004 01:59:59 GMT

Hi,

here is the second patch to make text rotation work. It is for  
NSAffineTransform -rotationAngle.
The patch just corrects the sign of the angle and always returns positive 
angles.

Georg



2004-03-14  Georg Fleischmann
        * gui/Source/NSAffineTransform.m [NSView rotationAngle]:
          change sign of angle, and always return positive angles



*** gui/Source/NSAffineTransform.m.old  2004-03-11 18:34:41.000000000 +0100
--- gui/Source/NSAffineTransform.m      2004-03-14 00:57:54.000000000 +0100
***************
*** 435,443 ****

  - (float) rotationAngle
  {
!   /* FIXME - this is not correct in general!  */
!   float rotationAngle = atan2(C, A);
    rotationAngle *= 180.0 / pi;

    return rotationAngle;
  }
--- 435,444 ----

  - (float) rotationAngle
  {
!   float rotationAngle = atan2(-C, A);
    rotationAngle *= 180.0 / pi;
+   if (rotationAngle < 0.0)
+     rotationAngle += 360.0;

    return rotationAngle;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]