mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Fix wrong SVG sizes with non-integer values for viewBox width/height.
Includes a standalone reftest.
This commit is contained in:
parent
4f41aebb67
commit
ee1233bb0c
2 changed files with 180 additions and 4 deletions
|
|
@ -241,8 +241,9 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
|
|||
nsSVGLength2 &height = content->mLengthAttributes[SVGSVGElement::ATTR_HEIGHT];
|
||||
|
||||
if (!width.IsPercentage() && !height.IsPercentage()) {
|
||||
nsSize ratio(NSToCoordRoundWithClamp(width.GetAnimValue(content)),
|
||||
NSToCoordRoundWithClamp(height.GetAnimValue(content)));
|
||||
nsSize ratio(
|
||||
nsPresContext::CSSPixelsToAppUnits(width.GetAnimValue(content)),
|
||||
nsPresContext::CSSPixelsToAppUnits(height.GetAnimValue(content)));
|
||||
if (ratio.width < 0) {
|
||||
ratio.width = 0;
|
||||
}
|
||||
|
|
@ -272,8 +273,8 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
|
|||
if (viewBoxHeight < 0.0f) {
|
||||
viewBoxHeight = 0.0f;
|
||||
}
|
||||
return nsSize(NSToCoordRoundWithClamp(viewBoxWidth),
|
||||
NSToCoordRoundWithClamp(viewBoxHeight));
|
||||
return nsSize(nsPresContext::CSSPixelsToAppUnits(viewBoxWidth),
|
||||
nsPresContext::CSSPixelsToAppUnits(viewBoxHeight));
|
||||
}
|
||||
|
||||
return nsSVGDisplayContainerFrame::GetIntrinsicRatio();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue