Instance Method

scale(by:)

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

Declaration

func scale(by scale: CGFloat)

Parameters

scale

The scaling factor to apply to both axes. Specifying a negative value has the effect of inverting the direction of the axes in addition to scaling them. A scaling factor of 1.0 scales the content to exactly the same size.

Discussion

After invoking this method, applying the receiver’s matrix modifies the unit lengths along the current x and y axes by a factor of scale, in addition to performing all previous transformations.

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 scaleX(by: CGFloat, yBy: CGFloat)

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

func translateX(by: CGFloat, yBy: CGFloat)

Applies the specified translation factors to 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.