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.
This commit is contained in:
Jan 2016-06-07 16:44:42 +02:00
parent b735a3ec95
commit e564955501

View file

@ -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;