Contents

clip(to:style:options:)

Adds a path to the context’s array of clip shapes.

Declaration

mutating func clip(to path: Path, style: FillStyle = FillStyle(), options: GraphicsContext.ClipOptions = ClipOptions())

Parameters

  • path:

    A Path that defines the shape of the clipping mask.

  • style:

    A Fillstyle that defines how to rasterize the shape.

  • options:

    Clip options that tell SwiftUI how to interpret the path as a clip shape. For example, you can invert the clip shape by setting the Inverse option.

Discussion

Call this method to add a shape to the array of clip shapes that the context uses to define a clipping mask. Shapes that you add affect only subsequent drawing operations.

See Also

Masking