зеркало из https://github.com/mozilla/gecko-dev.git
Bug 654858: Fix float-to-nscoord rounding issue in SVG intrinsic ratio, with certain GCC versions & optimizations. r=roc
This commit is contained in:
Родитель
4536b07f04
Коммит
4448ac6bea
|
@ -275,7 +275,8 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
|
|||
nsSVGLength2 &height = content->mLengthAttributes[nsSVGSVGElement::HEIGHT];
|
||||
|
||||
if (!width.IsPercentage() && !height.IsPercentage()) {
|
||||
nsSize ratio(width.GetAnimValue(content), height.GetAnimValue(content));
|
||||
nsSize ratio(NSToCoordRoundWithClamp(width.GetAnimValue(content)),
|
||||
NSToCoordRoundWithClamp(height.GetAnimValue(content)));
|
||||
if (ratio.width < 0) {
|
||||
ratio.width = 0;
|
||||
}
|
||||
|
@ -296,7 +297,8 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
|
|||
if (viewBoxHeight < 0.0f) {
|
||||
viewBoxHeight = 0.0f;
|
||||
}
|
||||
return nsSize(viewBoxWidth, viewBoxHeight);
|
||||
return nsSize(NSToCoordRoundWithClamp(viewBoxWidth),
|
||||
NSToCoordRoundWithClamp(viewBoxHeight));
|
||||
}
|
||||
|
||||
return nsSVGOuterSVGFrameBase::GetIntrinsicRatio();
|
||||
|
|
Загрузка…
Ссылка в новой задаче