ShapeTransform
public struct ShapeTransform : Codable, Equatable
Simplified representation of three ordered affine transforms (translate,
rotate, scale) that can be applied to ShapeWithTransform.
-
Declaration
Swift
public var translation: CGPoint -
Declaration
Swift
public var rotation: CGFloat -
Declaration
Swift
public var scale: CGFloat -
Declaration
Swift
public static let identity: ShapeTransform -
Returns
trueiff this shape has zero translation, zero rotation, and 1 scaleDeclaration
Swift
public var isIdentity: Bool { get } -
Representation of this transform as a
CGAffineTransformDeclaration
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
View on GitHub
ShapeTransform Structure Reference