Skip to content

Commit b611909

Browse files
Bugfix FXIOS-14016 [SEC] Fix PDF icon sizing (#30379)
[FXIOS-14016] Fix PDF search engine icon sizing
1 parent 6357199 commit b611909

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

firefox-ios/Client/Extensions/UIImage+RenderingUtilities.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ extension UIImage {
2323

2424
// Scale proportionately to optional minimum size.
2525
let size: CGSize
26+
var scaleRatio = 1.0
2627
if let minSize = minimumSize {
2728
let xScaleRatio = minSize.width / baseSize.width
2829
let yScaleRatio = minSize.height / baseSize.height
29-
let scaleRatio = max(max(xScaleRatio, yScaleRatio), 1.0)
30+
scaleRatio = max(max(xScaleRatio, yScaleRatio), 1.0)
3031
size = CGSize(width: baseSize.width * scaleRatio, height: baseSize.height * scaleRatio)
3132
} else {
3233
size = baseSize
@@ -41,7 +42,7 @@ extension UIImage {
4142

4243
// Coordinate system must be flipped to match PDF rendering
4344
cgContext.translateBy(x: 0, y: size.height)
44-
cgContext.scaleBy(x: 1, y: -1)
45+
cgContext.scaleBy(x: scaleRatio, y: -scaleRatio)
4546
page.draw(with: .mediaBox, to: cgContext)
4647
}
4748
}

0 commit comments

Comments
 (0)