Declaration
compose().intersection(
other: SwiftUI.Shape,
options?: {
eoFill?: boolean;
}
)@export(implementation) nonisolated func intersection<T>(
_ other: T,
eoFill: Bool = false
) -> some Shape
where T : ShapeParameters
other*SwiftUI.ShapeThe shape to intersect.
options.eoFillbooleanWhether 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 filled region of the resulting shape is the overlapping area of the filled region of both shapes. This can be used to clip the fill of a shape to a mask.
Any unclosed subpaths in either shape are assumed to be closed. The result of filling this shape using either even-odd or non-zero fill rules is identical.
See also
More in Shape modifiers.
- fillFills this shape with a color or gradient.
- lineIntersectionReturns a new shape with a line from this shape that overlaps the filled regions of the given shape.
- lineSubtractionReturns a new shape with a line from this shape that does not overlap the filled region of the given shape.
- offsetChanges the relative position of this shape using the specified size.
- pathDescribes this shape as a path within a rectangular frame of reference.
- rotationRotates this shape around an anchor point at the angle you specify.
- scaleScales this shape without changing its bounding frame.
- sizeReturns a new version of self representing the same shape, but that will ask it to create its path from a rect of size. This does not affect the layout properties of any views created from the shape (e.g. by filling it).
- strokeTraces the outline of this shape with a color or gradient.
- subtractingReturns a new shape with filled regions from this shape that are not in the given shape.
- symmetricDifferenceReturns a new shape with filled regions either from this shape or the given shape, but not in both.
- transformApplies an affine transform to this shape.