Bug 992731: Correctly treat a 'line' as a curve with a single inflection point stretching across the entire line. r=jwatt

This commit is contained in:
Bas Schouten 2014-05-31 03:13:23 +02:00
parent 55d3c4f46c
commit 4f4c6575e4

View File

@ -375,8 +375,15 @@ FindInflectionPoints(const BezierControlPoints &aControlPoints,
// Instead of a linear acceleration change we have a constant
// acceleration change. This means the equation has no solution
// and there are no inflection points, unless the constant is 0.
// In that case the curve is a straight line, but we'll let
// FlattenBezierCurveSegment deal with this.
// In that case the curve is a straight line, essentially that means
// the easiest way to deal with is is by saying there's an inflection
// point at t == 0. The inflection point approximation range found will
// automatically extend into infinity.
if (c == 0) {
*aCount = 1;
*aT1 = 0;
return;
}
*aCount = 0;
return;
}