Skip to content

Commit db6ed69

Browse files
committed
fix(image): ios fix for when ZoomImage is used inside a pager
1 parent c333bc5 commit db6ed69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/zoomimage/platforms/ios/src/ImageScrollView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,16 @@ open class ImageScrollView: UIScrollView {
176176

177177
@objc func updateForImage(_ size: CGSize) {
178178
imageSize = size
179-
contentSize = imageSize
179+
// contentSize = imageSize
180180
// setMaxMinZoomScalesForCurrentBounds()
181181
// zoomScale = minimumZoomScale
182182

183183
switch initialOffset {
184184
case .begining:
185185
contentOffset = CGPoint.zero
186186
case .center:
187-
let xOffset = contentSize.width < bounds.width ? 0 : (contentSize.width - bounds.width)/2
188-
let yOffset = contentSize.height < bounds.height ? 0 : (contentSize.height - bounds.height)/2
187+
let xOffset = imageSize.width < bounds.width ? 0 : (imageSize.width - bounds.width)/2
188+
let yOffset = imageSize.height < bounds.height ? 0 : (imageSize.height - bounds.height)/2
189189

190190
switch _zoomView?.contentMode {
191191
case .scaleAspectFit:

0 commit comments

Comments
 (0)