Discussion:
Fix, NSAffineTransform (Text Rotation)
Georg Fleischmann
2004-03-14 01:59:59 UTC
Permalink
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;
}
Alexander Malmberg
2004-03-22 01:05:06 UTC
Permalink
Post by Georg Fleischmann
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.
Applied, thanks! Sorry for taking so long.

- Alexander Malmberg

Loading...