lokesh/lightbox2 — pull request #49 by Heleen (2013-07-05 08:40:16+00:00)
Title: Fit images in viewport is limited to horizontal viewport size FIX

Yesterday I submitted an issue: https://github.com/lokesh/lightbox2/issues/48.
The fix code I added in that issue was mathematically incorrect, something I realised today. I Googled it and used http://stackoverflow.com/a/1106367/368102 to fix it. And while I was at it I thought I might as well do it properly and fix it in the Coffeescript in a Github fork.
So here is the pull request to pull it in if you like. If not, feel free to ignore it.
I will close the issue now with a link to this pull request.

Git commit comment:
So far the fit to viewport only scaled the image if it was wider than the viewport and not if it was higher.
This fix will scale the image if it is either wider, higher, or both than the viewport, based on which scaling factor is larger (see this Stackoverflow question: http://stackoverflow.com/a/1106367/368102).