diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-08-29 10:49:25 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-08-29 10:49:25 -0700 |
commit | 1527f149a90a46428c48b4b811d4b8ecc10b9d2c (patch) | |
tree | 5132259e5e703dce92e8a025d007de3b220d8457 /lib/gallery.common.js | |
parent | b833cb607323000b987428c94995e18a9d07df65 (diff) | |
parent | b518a5173da57d65d454518fd2400fe28cdfef3c (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'lib/gallery.common.js')
-rw-r--r-- | lib/gallery.common.js | 15 |
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); - |