diff --git a/ChangeLog b/ChangeLog index 052536abd..4e9d7cd4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-01-06 21:58 Gregory John Casamento + + * Source/NSAffineTransform.m: More documentation. + 2004-01-07 02:51 Alexander Malmberg * Source/NSSplitView.m (-mouseDown:): Use an NSDebugLLog when we get @@ -15,7 +19,7 @@ 2004-01-03 Ludovic Marcotte * Source/NSOutlineView.m: Started to fix the DnD code. - Modified -mouseDown: to not select the row when clicking + Modified -mouseDown: to not select the row when clicking only on the expand/collapse image. Rewrote -noteNumberOfRowsChanged to correctly restore the list of selected rows after an expand/collapse operation. diff --git a/Source/NSAffineTransform.m b/Source/NSAffineTransform.m index 30e5c25b1..49af34bbb 100644 --- a/Source/NSAffineTransform.m +++ b/Source/NSAffineTransform.m @@ -47,7 +47,7 @@ #define TX matrix.tX #define TY matrix.tY -/* A Postscript matrix look like this: +/* A Postscript matrix looks like this: / a b 0 \ | c d 0 | @@ -88,9 +88,9 @@ static NSAffineTransformStruct identityTransform = { } /** - * Appends one transform matrix to another. It does this by performing a + * Appends one transform matrix to another. This is done by performing a * matrix multiplication of the receiver with aTransform. The resulting - * matrix then replaces the receiver. + * matrix then replaces the receiver's matrix. */ - (void) appendTransform: (NSAffineTransform*)aTransform { @@ -125,7 +125,8 @@ static NSAffineTransformStruct identityTransform = { } /** - * Initialize the transformation matrix. + * Initialize the transformation matrix instance to the identity matrix. + * The identity matrix transforms a point to itself. */ - (id) init { @@ -134,7 +135,8 @@ static NSAffineTransformStruct identityTransform = { } /** - * Initialize the receiever's instance with the instance represented by aTransform. + * Initialize the receiever's instance with the instance represented + * by aTransform. */ - (id) initWithTransform: (NSAffineTransform*)aTransform { @@ -143,7 +145,8 @@ static NSAffineTransformStruct identityTransform = { } /** - * Calculates the inverse of the receiver's matrix and replaces the receiever's matrix with it. + * Calculates the inverse of the receiver's matrix and replaces the + * receiever's matrix with it. */ - (void) invert { @@ -192,7 +195,8 @@ static NSAffineTransformStruct identityTransform = { } /** - * Rotates the transformation matrix of the receiver counter-clockwise + * Applies the rotation specified by angle in degrees. Points trasnformed + * with the transformation matrix of the receiver are rotated counter-clockwise * by the number of degrees specified by angle. */ - (void) rotateByDegrees: (float)angle @@ -210,7 +214,8 @@ static NSAffineTransformStruct identityTransform = { } /** - * Rotates the transformation matrix of the receiver counter-clockwise + * Applies the rotation specified by angle in radians. Points trasnformed + * with the transformation matrix of the receiver are rotated counter-clockwise * by the number of radians specified by angle. */ - (void) rotateByRadians: (float)angleRad @@ -237,8 +242,8 @@ static NSAffineTransformStruct identityTransform = { } /** - * Scales the X axis of the receiver's transformation matrix by scaleX and - * the Y axis of the transformation matrix by scaleY. + * Scales the X axis of the receiver's transformation matrix + * by scaleX and the Y axis of the transformation matrix by scaleY. */ - (void) scaleXBy: (float)scaleX yBy: (float)scaleY { @@ -246,6 +251,11 @@ static NSAffineTransformStruct identityTransform = { C *= scaleY; D *= scaleY; } +/** + * Get the currently active graphics context's transformation + * matrix and set it into the receiver. + */ + - (void) set { GSSetCTM(GSCurrentContext(), self); @@ -262,6 +272,13 @@ static NSAffineTransformStruct identityTransform = { matrix = val; } +/** + *

+ * Applies the receiver's transformation matrix to each point in + * the bezier path, then returns the result. The original bezier + * path is not modified. + *

+ */ - (NSBezierPath*) transformBezierPath: (NSBezierPath*)aPath { NSBezierPath *path = [aPath copy]; @@ -304,7 +321,8 @@ static NSAffineTransformStruct identityTransform = { /** *

- * Returns the structure which represents the matrix of the reciever. + * Returns the NSAffineTransformStruct structure + * which represents the matrix of the reciever. * The struct is of the form:

*

{m11, m12, m21, m22, tX, tY}

*/ @@ -314,7 +332,9 @@ static NSAffineTransformStruct identityTransform = { } /** - * Scales the receiver's matrix based on the factors tranX and tranY. + * Applies the translation specified by tranX and tranY to the receiver's matrix. + * Points transformed by the reciever's matrix after this operation will + * be shifted in position based on the specified translation. */ - (void) translateXBy: (float)tranX yBy: (float)tranY {