Skip to content

Commit 6b79472

Browse files
authored
Fix dimensions details (#1636)
The dimensions details should now display the image's natural size. Apparently since its introduction by commit e891d02, the dimensions details have divided the image's natural size by the the zoom factor. I'm not sure why this was done. *Multiplying* by the zoom factor would at least compute the displayed size (although I think this is a less desirable metric to show than the natural size). But dividing doesn't seem to produce any sensible metric.
1 parent 8df74ac commit 6b79472

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/hoverzoom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,7 @@ var hoverZoom = {
22982298
function getSrcDetails(link) {
22992299
let details = {};
23002300
if (!srcDetails.audio || srcDetails.video) {
2301-
if (srcDetails.naturalWidth) details.dimensions = Math.round(srcDetails.naturalWidth / parseInt(options.zoomFactor)) + 'x' + Math.round(srcDetails.naturalHeight / parseInt(options.zoomFactor));
2301+
if (srcDetails.naturalWidth) details.dimensions = srcDetails.naturalWidth + 'x' + srcDetails.naturalHeight;
23022302
if (srcDetails.naturalWidth) details.ratio = getImgRatio(srcDetails.naturalWidth, srcDetails.naturalHeight);
23032303
let displayedWidth = imgFullSize.width() || imgFullSize[0].width;
23042304
if (srcDetails.naturalWidth) details.scale = Math.round(100.0 * displayedWidth / srcDetails.naturalWidth) + '%';

0 commit comments

Comments
 (0)