1
0

Rectangle.swift 386 B

12345678910111213
  1. /// A rectangle.
  2. public struct Rectangle: InsettableShape {
  3. /// Creates a ``Rectangle`` instance.
  4. public nonisolated init() {}
  5. public nonisolated func path(in bounds: Path.Rect) -> Path {
  6. Path().addRectangle(bounds)
  7. }
  8. public nonisolated func inset(by amount: Double) -> some InsettableShape {
  9. InsettableShapeImpl(inset: amount, base: self)
  10. }
  11. }