From 836e7a52ed899eb20418fb8e17c7222466d4da86 Mon Sep 17 00:00:00 2001 From: William Chen Date: Wed, 2 Feb 2022 11:31:03 -0500 Subject: [PATCH] fix: calculate squaredZoomScale when media asset is loaded --- Source/Pages/Gallery/YPAssetZoomableView.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Pages/Gallery/YPAssetZoomableView.swift b/Source/Pages/Gallery/YPAssetZoomableView.swift index 60cb87147..25e7d66bf 100644 --- a/Source/Pages/Gallery/YPAssetZoomableView.swift +++ b/Source/Pages/Gallery/YPAssetZoomableView.swift @@ -75,6 +75,8 @@ final class YPAssetZoomableView: UIScrollView { strongSelf.videoView.setPreviewImage(preview) strongSelf.setAssetFrame(for: strongSelf.videoView, with: preview) + + strongSelf.squaredZoomScale = strongSelf.calculateSquaredZoomScale() completion() @@ -131,6 +133,8 @@ final class YPAssetZoomableView: UIScrollView { // add update CropInfo after multiple updateCropInfo() } + + strongSelf.squaredZoomScale = strongSelf.calculateSquaredZoomScale() completion(isLowResIntermediaryImage) }