Closed teo1978 closed 7 years ago
This was actually a case of flawed documentation. The aspect ratio is maintained if one of the max options is set. I've updated the options description as well as added a comment in the source javascript for clarity. Thanks for catching.
http://lokeshdhakar.com/projects/lightbox2/#options https://github.com/lokesh/lightbox2/blob/master/src/js/lightbox.js#L307
From the docs:
The fact that the aspect ratio will not be maintained renders these options completely useless. There are use cases for these options: one may want the image size to never exceed some given measures; however nobody in their right mind would accept to alter the aspect ratio in these cases.
So, if you want these options to be of any use, you shoud make them preserve aspect ratio. If you really want to also support the ability to force a max width and/or height loosing the aspect ratio, then add a
maintainAspectRatio
(or something) parameter which would be true by default.