]> _ Git - pmi.git/commitdiff
wip #3036 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Oct 2019 16:01:37 +0000 (18:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Oct 2019 16:01:37 +0000 (18:01 +0200)
resources/js/carrousel.js

index 5b9251f25e7f18777404c7adb98fe67d1bf38dc1..196355cae500cf25a5a29fd2f2d5a95f5fe23688 100644 (file)
@@ -108,14 +108,16 @@ window.Hammer = Hammer.default;
 
                 var factor = Math.max(widthFactor, heightFactor);
 
-                var iw = naturalWidth * factor;
-                var ih = naturalHeight * factor;
+                var iw = Math.round(naturalWidth * factor);
+                var ih = Math.round(naturalHeight * factor);
                 var left = (cw - iw) / 2;
                 var top = (ch - ih) / 2;
 
                 $(this).css({
                     width: iw,
                     height: ih,
+                    maxHeight: ih,
+                    maxWidth: iw,
                     top: top,
                     left: left
                 });