From 2db7841e47fdd3dd25142af84af0d8d810732b22 Mon Sep 17 00:00:00 2001 From: Holmes Futrell Date: Fri, 21 Sep 2018 16:49:34 -0700 Subject: [PATCH 1/2] fixed critical logic error in CrossingsRemoved and added unit test assertions to catch this problem. The method could fail if paths started inside themselves. --- BezierKit/BezierKitTests/PathTests.swift | 9 +++++++++ BezierKit/Library/AugmentedGraph.swift | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/BezierKit/BezierKitTests/PathTests.swift b/BezierKit/BezierKitTests/PathTests.swift index ee3c4fd9..74da4451 100644 --- a/BezierKit/BezierKitTests/PathTests.swift +++ b/BezierKit/BezierKitTests/PathTests.swift @@ -418,6 +418,7 @@ class PathTests: XCTestCase { CGPoint(x: 1, y: 1), CGPoint(x: 2, y: 1), CGPoint(x: 0, y: 3), + CGPoint(x: 0, y: 0) ] let cgPath = CGMutablePath() cgPath.addLines(between: points) @@ -437,6 +438,14 @@ class PathTests: XCTestCase { XCTAssertEqual(result.subpaths.count, 1) XCTAssertTrue(componentsEqualAsideFromElementOrdering(result.subpaths[0], expectedResult.subpaths[0])) + // check also that the algorithm works when the first point falls *inside* the path + let cgPathAlt = CGMutablePath() + cgPathAlt.addLines(between: Array(points[3.. Date: Fri, 21 Sep 2018 16:56:03 -0700 Subject: [PATCH 2/2] update version # --- BezierKit.podspec | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BezierKit.podspec b/BezierKit.podspec index 65f52a85..b1f354cf 100644 --- a/BezierKit.podspec +++ b/BezierKit.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |s| s.name = "BezierKit" - s.version = "0.1.11" + s.version = "0.1.12" s.summary = "comprehensive Bezier curve library written in Swift" s.homepage = "https://github.com/hfutrell/BezierKit" s.license = "MIT" diff --git a/README.md b/README.md index 618f3100..45607222 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ To integrate BezierKit into your Xcode project using CocoaPods, add it to your t ```ruby target '' do - pod 'BezierKit', '>= 0.1.11' + pod 'BezierKit', '>= 0.1.12' end ```