Merge pull request #907 from iconexperience/getMonoCurves-performance-improvement

Improve performance of _getMonoCurves() by filtering more curves
This commit is contained in:
Jürg Lehni 2016-01-16 15:09:16 +01:00
commit b3e81af9b6

View file

@ -913,8 +913,10 @@ Path.inject(/** @lends Path# */{
y1 = v[3],
y2 = v[5],
y3 = v[7];
if (Curve.isStraight(v)) {
// Handling straight curves is easy.
if (Curve.isStraight(v) ||
y0 >= y1 === y1 >= y2 && y1 >= y2 === y2 >= y3) {
// Straight curves and curves with end and control points sorted
// in y direction are guaranteed to be monotone in y direction.
insertCurve(v);
} else {
// Split the curve at y extrema, to get bezier curves with clear