Instance Method

translateX(by:yBy:)

Applies the specified translation factors to the receiver’s transformation matrix.

Declaration

func translateX(by deltaX: CGFloat, yBy deltaY: CGFloat)

Parameters

deltaX

The number of units to move along the x axis.

deltaY

The number of units to move along the y axis.

Discussion

Subsequent transformations cause coordinates to be shifted by deltaX units along the x axis and by deltaY units along the y axis. Translation factors do not affect NSSize values, which specify a differential between points.

See Also

Accumulating Transformations

func rotate(byDegrees: CGFloat)

Applies a rotation factor (measured in degrees) to the receiver’s transformation matrix.

func rotate(byRadians: CGFloat)

Applies a rotation factor (measured in radians) to the receiver’s transformation matrix.

func scale(by: CGFloat)

Applies the specified scaling factor along both x and y axes to the receiver’s transformation matrix.

func scaleX(by: CGFloat, yBy: CGFloat)

Applies scaling factors to each axis of the receiver’s transformation matrix.

func append(AffineTransform)

Appends the specified matrix to the receiver’s matrix.

func prepend(AffineTransform)

Prepends the specified matrix to the receiver’s matrix.

func invert()

Replaces the receiver’s matrix with its inverse matrix.