summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-08-28 13:47:36 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-08-28 13:47:36 -0700
commit31d63a0d0a27212435a78eb38461320f486b5f95 (patch)
tree68782a88d954e7ae4f0d793b3b2483e720a74beb /lib
parent1d5262f9c354a8564f05a8a31b915ad479f4d361 (diff)
parent1855642bd169a1cae69cd9efb8da4458ea6e4a3c (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'lib')
-rw-r--r--lib/gallery.common.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/gallery.common.js b/lib/gallery.common.js
index a959d90d..c6a619c1 100644
--- a/lib/gallery.common.js
+++ b/lib/gallery.common.js
@@ -140,19 +140,18 @@
/* after scaling the width, check that the height fits */
if (imageHeight > height) {
- ratio = height / imageHeight;
- imageWidth *= ratio;
- imageHeight *= ratio;
+ ratio = height / imageHeight;
+ imageWidth *= ratio;
+ imageHeight *= ratio;
}
// handle the case where the calculation is almost zero (2.14e-14)
return {
- top: Number((height - imageHeight) / 2),
- left: Number((width - imageWidth) / 2),
- width: Number(imageWidth),
- height: Number(imageHeight)
+ top: Number((height - imageHeight) / 2),
+ left: Number((width - imageWidth) / 2),
+ width: Number(imageWidth),
+ height: Number(imageHeight)
};
};
})(jQuery);
-