Skip to content

Implement Circle and other basic shapes #503

@Kyle-Ye

Description

@Kyle-Ye

Description

While the Shape protocol exists in OpenSwiftUI, basic shape implementations like Circle, Rectangle, RoundedRectangle, Ellipse, and Capsule are missing or incomplete.

API Reference

SwiftUI's built-in shapes: https://developer.apple.com/documentation/swiftui/shapes

Expected API

struct Circle: Shape {
    func path(in rect: CGRect) -> Path
}

struct Rectangle: Shape {
    func path(in rect: CGRect) -> Path
}

struct RoundedRectangle: Shape {
    var cornerRadius: CGFloat
    var style: RoundedCornerStyle
    
    func path(in rect: CGRect) -> Path
}

struct Ellipse: Shape {
    func path(in rect: CGRect) -> Path
}

struct Capsule: Shape {
    var style: RoundedCornerStyle
    
    func path(in rect: CGRect) -> Path
}

Use Case

Basic shapes are fundamental building blocks for UI design. Currently referenced in multiple example files but commented out.

References

  • Example usage commented out in: Example/SharedExample/Animation/Timeline/AnimatedColorTimelineView.swift
  • Shape protocol exists in: Sources/OpenSwiftUICore/Shape/Shape.swift

Priority

High - Essential for basic UI construction

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Top priorityenhancementNew feature or requesthelp wantedPR contribution is appreciated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions