ShapeTransform

public struct ShapeTransform : Codable

Simplified representation of three ordered affine transforms (translate, rotate, scale) that can be applied to ShapeWithTransform.

  • Returns true iff this shape has zero translation, zero rotation, and 1 scale

    Declaration

    Swift

    public var isIdentity: Bool { get }
  • Representation of this transform as a CGAffineTransform

    Declaration

    Swift

    public var affineTransform: CGAffineTransform { get }
  • Apply this transform in Core Graphics

    Declaration

    Swift

    public func begin(context: CGContext)
  • Unapply this transform in Core Graphics (must be paired with exactly one begin(context:) at the same GState nesting level!)

    Declaration

    Swift

    public func end(context: CGContext)
  • Return a copy of this transform with its translation moved by the given amount

    Declaration

    Swift

    public func translated(by delta: CGPoint) -> ShapeTransform
  • Return a copy of this transform with its scale multiplied by the given amount

    Declaration

    Swift

    public func scaled(by amount: CGFloat) -> ShapeTransform
  • Return a copy of this transform with its rotation changed by the given amount

    Declaration

    Swift

    public func rotated(by radians: CGFloat) -> ShapeTransform