File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
firefox-ios/Client/Extensions Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments