From 928b458204a197ca6ecb3ab05f0bfc37d1310e8c Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 18 Oct 2019 18:01:37 +0200 Subject: [PATCH] wip #3036 @1.5 --- resources/js/carrousel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/js/carrousel.js b/resources/js/carrousel.js index 5b9251f..196355c 100644 --- a/resources/js/carrousel.js +++ b/resources/js/carrousel.js @@ -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 }); -- 2.39.5