Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 83c85ba

Browse files
committed
Bug 1776098 - Ensure small scaled vector images are rendered. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151119
1 parent 547c9f9 commit 83c85ba

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed
Lines changed: 19 additions & 0 deletions
Loading

layout/reftests/svg/image/reftest.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fuzzy(0-1,0-100) == image-opacity-02.svg image-opacity-02-ref.svg # Bug 776039 f
1010
== image-rotate-02b.svg image-rotate-02-ref.svg
1111
== image-scaling-01.svg ../pass.svg
1212
== image-scaling-02.svg ../pass.svg
13+
== image-scaling-03.svg ../pass.svg
1314
== image-svg-inline-01.html ../pass.svg
1415
== image-svg-inline-zoom-in-01a.html ../pass.svg
1516
== image-svg-inline-zoom-in-01b.html ../pass.svg

layout/svg/SVGImageFrame.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void SVGImageFrame::PaintSVG(gfxContext& aContext, const gfxMatrix& aTransform,
375375
// of the SVG image's internal document that is visible, in combination
376376
// with preserveAspectRatio and viewBox.
377377
const SVGImageContext context(
378-
Some(CSSIntSize::Truncate(width, height)),
378+
Some(CSSIntSize::Ceil(width, height)),
379379
Some(imgElem->mPreserveAspectRatio.GetAnimValue()));
380380

381381
// For the actual draw operation to draw crisply (and at the right size),
@@ -617,7 +617,7 @@ bool SVGImageFrame::CreateWebRenderCommands(
617617
flags |= imgIContainer::FLAG_RECORD_BLOB;
618618
}
619619
// Forward preserveAspectRatio to inner SVGs
620-
svgContext.SetViewportSize(Some(CSSIntSize::Truncate(width, height)));
620+
svgContext.SetViewportSize(Some(CSSIntSize::Ceil(width, height)));
621621
svgContext.SetPreserveAspectRatio(
622622
Some(imgElem->mPreserveAspectRatio.GetAnimValue()));
623623
}

0 commit comments

Comments
 (0)