lineIntersection

Returns a new shape with a line from this shape that overlaps the filled regions of the given shape.

Shape ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+lineIntersection(_:eoFill:) in SwiftUI

Declaration

React
compose().lineIntersection(
  other: SwiftUI.Shape,
  options?: {
    eoFill?: boolean;
  }
)
Swift
@export(implementation) nonisolated func lineIntersection<T>(
    _ other: T,
    eoFill: Bool = false
) -> some Shape
where T : Shape

Parameters

  • The shape to intersect.

  • options.eoFillboolean

    Whether to use the even-odd rule for determining which areas to treat as the interior of the shapes (if true), or the non-zero rule (if false).

Return value

A new shape.

Discussion

The line of the resulting shape is the line of this shape that overlaps the filled region of other.

Intersected subpaths that are clipped create open subpaths. Closed subpaths that do not intersect other remain closed.

See also

More in Shape modifiers.