diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt index 88d5de466..cf28f4330 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/fragments/PhotoFragment.kt @@ -335,7 +335,6 @@ class PhotoFragment : ViewPagerFragment() { } private fun loadSVG() { - setupGestureView() Glide.with(context!!) .`as`(PictureDrawable::class.java) .listener(SvgSoftwareLayerSetter()) @@ -356,9 +355,10 @@ class PhotoFragment : ViewPagerFragment() { if (degrees != 0) { picasso.rotate(degrees.toFloat()) + } else { + degreesForRotation(mImageOrientation).toFloat() } - setupGestureView() picasso.into(mView.gestures_view, object : Callback { override fun onSuccess() { mView.gestures_view.controller.settings.isZoomEnabled = degrees != 0 || context?.config?.allowZoomingImages == false @@ -377,13 +377,6 @@ class PhotoFragment : ViewPagerFragment() { } } - private fun setupGestureView() { - mView.gestures_view.controller.apply { - settings.maxZoom = 3f - settings.overzoomFactor = 1.2f - } - } - private fun tryLoadingWithGlide() { var targetWidth = if (mScreenWidth == 0) com.bumptech.glide.request.target.Target.SIZE_ORIGINAL else mScreenWidth var targetHeight = if (mScreenHeight == 0) com.bumptech.glide.request.target.Target.SIZE_ORIGINAL else mScreenHeight @@ -456,9 +449,9 @@ class PhotoFragment : ViewPagerFragment() { isQuickScaleEnabled = config.oneFingerZoom isOneToOneZoomEnabled = config.allowOneToOneZoom setResetScaleOnSizeChange(false) - setImage(ImageSource.uri(path)) setOrientation(rotation) setEagerLoadingEnabled(false) + setImage(ImageSource.uri(path)) setOnImageEventListener(object : SubsamplingScaleImageView.OnImageEventListener { override fun onImageLoaded() { }