Bug 1246893 - Fix boundary values of nsSMILKeySpline::GetTForX. r=birtles

MozReview-Commit-ID: 9KX0aLPRP31
This commit is contained in:
Hiroyuki Ikezoe 2016-02-16 13:59:36 +09:00
parent 16f91c5780
commit 1ba68294a3

View File

@ -76,6 +76,10 @@ nsSMILKeySpline::GetSlope(double aT,
double
nsSMILKeySpline::GetTForX(double aX) const
{
// Early return when aX == 1.0 to avoid floating-point inaccuracies.
if (aX == 1.0) {
return 1.0;
}
// Find interval where t lies
double intervalStart = 0.0;
const double* currentSample = &mSampleValues[1];