Skip to content

Commit

Permalink
Added public initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranb662 authored Jul 29, 2020
1 parent 4ed7611 commit d9942d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/Shapes/TangentArc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@

import SwiftUI

struct TangentArc: Shape {
public struct TangentArc: Shape {
public var start: CGPoint
public var tangent1End: CGPoint
public var tangent2End: CGPoint
public var radius: CGFloat

public init(start: CGPoint, tangent1End: CGPoint, tangent2End: CGPoint, radius: CGFloat) {
self.start = start
self.tangent1End = tangent1End
self.tangent2End = tangent2End
self.radius = radius
}

public var animatableData: AnimatablePair<AnimatablePair<CGPoint, CGFloat>, AnimatablePair<CGPoint, CGPoint>> {
get {AnimatablePair(AnimatablePair(self.start, self.radius), AnimatablePair(self.tangent1End, self.tangent2End))}
Expand All @@ -24,7 +31,7 @@ struct TangentArc: Shape {
}
}

func path(in rect: CGRect) -> Path {
public func path(in rect: CGRect) -> Path {
Path { path in
path.move(to: start)
path.addArc(tangent1End: tangent1End, tangent2End: tangent2End, radius: radius)
Expand Down

0 comments on commit d9942d6

Please sign in to comment.