зеркало из https://github.com/mozilla/gecko-dev.git
Bug 769902 - Avoid unnecessary precision issues in nsSVGUtils::ObjectSpace. r=longsonr.
This commit is contained in:
Родитель
0ebf8c84cf
Коммит
3379f2249a
|
@ -831,7 +831,7 @@ nsSVGUtils::ComputeNormalizedHypotenuse(double aWidth, double aHeight)
|
|||
float
|
||||
nsSVGUtils::ObjectSpace(const gfxRect &aRect, const nsSVGLength2 *aLength)
|
||||
{
|
||||
float fraction, axis;
|
||||
float axis;
|
||||
|
||||
switch (aLength->GetCtxType()) {
|
||||
case X:
|
||||
|
@ -848,15 +848,11 @@ nsSVGUtils::ObjectSpace(const gfxRect &aRect, const nsSVGLength2 *aLength)
|
|||
axis = 0.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
if (aLength->IsPercentage()) {
|
||||
fraction = aLength->GetAnimValInSpecifiedUnits() / 100;
|
||||
} else {
|
||||
fraction = aLength->GetAnimValue(static_cast<nsSVGSVGElement*>
|
||||
(nsnull));
|
||||
// Multiply first to avoid precision errors:
|
||||
return axis * aLength->GetAnimValInSpecifiedUnits() / 100;
|
||||
}
|
||||
|
||||
return fraction * axis;
|
||||
return aLength->GetAnimValue(static_cast<nsSVGSVGElement*>(nsnull)) * axis;
|
||||
}
|
||||
|
||||
float
|
||||
|
|
Загрузка…
Ссылка в новой задаче