Skip to content

Commit

Permalink
resolve todo
Browse files Browse the repository at this point in the history
  • Loading branch information
hfutrell committed May 24, 2019
1 parent b34c0d1 commit 3a78128
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion BezierKit/Library/AugmentedGraph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ internal class PathLinkedListRepresentation {
let prev = startingVertex.emitPrevious()
let p = prev.compute(0.5)
let n = prev.normal(0.5)
#warning("you need to add an API for this one!")
let line = LineSegment(p0: p, p1: p + n)
let intersections = path.intersections(with: Path(curve: line))
let s: CGFloat = 0.5 * (intersections.map({$0.indexedPathLocation2.t}).first(where: {$0 > 0}) ?? 1.0)
Expand Down
2 changes: 1 addition & 1 deletion BezierKit/Library/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ internal func windingCountImpliesContainment(_ count: Int, using rule: PathFillR
}

convenience public init(curve: BezierCurve) {
self.init(components: [PathComponent(curves: [curve])])
self.init(components: [PathComponent(curve: curve)])
}

// MARK: - NSCoding
Expand Down
4 changes: 4 additions & 0 deletions BezierKit/Library/PathComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ import Foundation
self.offsets = PathComponent.computeOffsets(from: self.orders)
}

convenience public init(curve: BezierCurve) {
self.init(curves: [curve])
}

private static func computeOffsets(from orders: [Int]) -> [Int] {
var offsets = [Int]()
offsets.reserveCapacity(orders.count)
Expand Down

0 comments on commit 3a78128

Please sign in to comment.