NSAffineTransform Additions Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Companion guide
Declared in
NSAffineTransform.h

Overview

The Application Kit extends Foundation’s NSAffineTransform class by adding:

Tasks

Setting and Building the Current Transformation Matrix

Transforming Bezier Paths

Instance Methods

concat

Appends the receiver’s matrix to the current transformation matrix stored in the current graphics context, replacing the current transformation matrix with the result.

- (void)concat
Discussion

Concatenation is performed by matrix multiplication—see “Manipulating Transform Values”.

If this method is invoked from within an NSView drawRect: method, then the current transformation matrix is an accumulation of the screen, window, and any superview’s transformation matrices. Invoking this method defines a new user coordinate system whose coordinates are mapped into the former coordinate system according to the receiver’s transformation matrix. To undo the concatenation, you must invert the receiver’s matrix and invoke this method again.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSAffineTransform.h

set

Sets the current transformation matrix to the receiver’s transformation matrix.

- (void)set
Discussion

The current transformation is stored in the current graphics context and is applied to subsequent drawing operations. You should use this method sparingly because it removes the existing transformation matrix, which is an accumulation of transformation matrices for the screen, window, and any superviews. Instead use the concat method to add this transformation matrix to the current transformation matrix.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSAffineTransform.h

transformBezierPath:

Creates and returns a new NSBezierPath object with each point in the given path transformed by the receiver.

- (NSBezierPath *)transformBezierPath:(NSBezierPath *)aPath
Parameters
aPath

An object representing the bezier path to be used in the transformation.

Discussion

The original NSBezierPath object is not modified.

Availability
  • Available in OS X v10.0 and later.
See Also
  • - transformPoint:transformSize:
Declared In
NSAffineTransform.h