Skip to content

Commit 97de3c9

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-95826' into EPAM-PR-23
2 parents f6f6e73 + 3ba63db commit 97de3c9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/web/mage/gallery/gallery.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@
764764
max-width: inherit;
765765
position: absolute;
766766
top: 0;
767+
object-fit: scale-down;
767768
}
768769
}
769770

lib/web/magnifier/magnifier.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,11 @@
542542
showWrapper = true;
543543
bindEvents(eventType, thumb);
544544
data[idx].status = 2;
545-
data[idx].zoom = largeObj.height / largeWrapper.height();
545+
if (largeObj.width > largeObj.height) {
546+
data[idx].zoom = largeObj.width / largeWrapper.width();
547+
} else {
548+
data[idx].zoom = largeObj.height / largeWrapper.height();
549+
}
546550
setThumbData(thumb, data[idx]);
547551
updateLensOnLoad(idx, thumb, largeObj, largeWrapper);
548552
}

0 commit comments

Comments
 (0)