Skip to content

Commit

Permalink
Merge pull request #8 from wzso/main
Browse files Browse the repository at this point in the history
Add Library Content Provider
  • Loading branch information
mkj-is authored Jul 22, 2023
2 parents a5580af + 50646b2 commit 130ab41
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Sources/PathBuilder/LibraryContent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import SwiftUI
import DeveloperToolsSupport

@available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
struct LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
Path {
Move(to: CGPoint(x: 0, y: 0))
// ...
Close()
}
)
LibraryItem(
Subpath {
Move(to: CGPoint(x: 0, y: 0))
// ...
}
)
LibraryItem(Arc(center: .zero, radius: 20, startAngle: .zero, endAngle: .degrees(180)))
LibraryItem(Close())
LibraryItem(Curve(to: CGPoint(x: 10, y: 10), control1: CGPoint(x: 5, y: 5), control2: CGPoint(x: 10, y: 10)))
LibraryItem(EmptySubpath())
LibraryItem(Line(to: CGPoint(x: 50, y: 50)))
LibraryItem(Lines(CGPoint(x: 60, y: 60), CGPoint(x: 70, y: 70)))
LibraryItem(Oval(in: CGRect(x: 0, y: 0, width: 10, height: 20)))
LibraryItem(QuadCurve(to: CGPoint(x: 0, y: 0), control: CGPoint(x: 10, y: 10)))
LibraryItem(Rect(CGRect(x: 0, y: 0, width: 100, height: 100), CGRect(x: 10, y: 10, width: 20, height: 30)))
LibraryItem(RelativeArc(center: CGPoint(x: 0, y: 0), radius: 10, startAngle: .degrees(60), delta: .degrees(180)))
LibraryItem(RoundedRect(in: CGRect(x: 10, y: 10, width: 20, height: 30), cornerSize: CGSize(width: 5, height: 10)))
LibraryItem(TangentArc(end1: CGPoint(x: 0, y: 0), end2: CGPoint(x: 10, y: 10), radius: 3))
}
}

0 comments on commit 130ab41

Please sign in to comment.