From e5649555015931e7743351861b88302bf016a14c Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 7 Jun 2016 16:44:42 +0200 Subject: [PATCH] Correclty implement sorting of intercepts `Array.sort()` without comparison function does not sort by numeric value, but by unicode characters (103 comes before 93 by this sorting), therefore a simple comparison function is required. --- src/path/PathItem.Boolean.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/path/PathItem.Boolean.js b/src/path/PathItem.Boolean.js index 11914630..b3d9d045 100644 --- a/src/path/PathItem.Boolean.js +++ b/src/path/PathItem.Boolean.js @@ -1044,7 +1044,7 @@ Path.inject(/** @lends Path# */{ } } } - intercepts.sort(); + intercepts.sort(function(a, b) {return a - b}); point.x = (intercepts[0] + intercepts[1]) / 2; } return point;