From 49026ae3c39d4deceb1207eb39bf1d92be77ecb9 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 10 Jul 2017 14:52:43 -0700 Subject: [PATCH] Fix off by one error --- partitionfinder/src/legalizer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partitionfinder/src/legalizer.rs b/partitionfinder/src/legalizer.rs index 6a761c62..a0caf88b 100644 --- a/partitionfinder/src/legalizer.rs +++ b/partitionfinder/src/legalizer.rs @@ -88,7 +88,7 @@ impl Legalizer { .last() .expect("`bezier_curve_to()` called with no current_subpath") .last_endpoint_index; - let point0 = self.endpoints[last_endpoint_index as usize].position; + let point0 = self.endpoints[last_endpoint_index as usize - 1].position; if iteration >= MAX_SUBDIVISIONS || [point0.x, point1.x, point2.x, endpoint.x].approx_ordered() { return self.monotone_bezier_curve_to(point1, point2, endpoint)