diff --git a/src/modules/zoom/zoom.mjs b/src/modules/zoom/zoom.mjs index e7617474d..9c4cead2d 100644 --- a/src/modules/zoom/zoom.mjs +++ b/src/modules/zoom/zoom.mjs @@ -28,6 +28,7 @@ export default function Zoom({ swiper, extendParams, on, emit }) { let isScaling = false; let fakeGestureTouched; let fakeGestureMoved; + let preventZoomOut; const evCache = []; const gesture = { originX: 0, @@ -270,7 +271,6 @@ export default function Zoom({ swiper, extendParams, on, emit }) { if (!image.isTouched || !gesture.slideEl) { return; } - if (!image.isMoved) { image.width = gesture.imageEl.offsetWidth || gesture.imageEl.clientWidth; image.height = gesture.imageEl.offsetHeight || gesture.imageEl.clientHeight; @@ -284,11 +284,6 @@ export default function Zoom({ swiper, extendParams, on, emit }) { const scaledWidth = image.width * zoom.scale; const scaledHeight = image.height * zoom.scale; - if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) { - allowTouchMove(); - return; - } - image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); image.maxX = -image.minX; image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0);