Instance Method インスタンスメソッド

draw(_:at:anchor:)

Draws a resolved symbol into the context, aligning an anchor within the symbol to a point in the context.

Declaration 宣言

func draw(_ symbol: GraphicsContext.ResolvedSymbol, at point: CGPoint, anchor: UnitPoint = .center)

Parameters パラメータ

symbol

The GraphicsContext.ResolvedSymbol view to draw. Get a resolved symbol by calling resolveSymbol(id:) with the identifier that you use to tag the corresponding child view during Canvas initialization.

point

A point within the rectangle of the resolved symbol to anchor to a point in the context.

anchor

A UnitPoint within the context to align the symbol with. The default is center.

Discussion 議論

The current context state defines the full drawing operation. For example, the current transformation and clip shapes affect how SwiftUI draws the symbol.

See Also 参照

Drawing a Child View