mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
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:
parent
b735a3ec95
commit
e564955501
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue