Paints a rectangular path, using the specified line width.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Graphics
A graphics context.
A rectangle, in user space coordinates.
A value, in user space units, that is greater than zero. This value does not affect the line width values in the current graphics state.
Aside from the line width value, Core Graphics uses the current attributes of the graphics state (such as stroke color) to paint the line. The line straddles the path, with half of the total width on either side.
The current path is cleared as a side effect of calling this function.