From 78a9cc8e6c4c2206fb7ba5d035ceed7279fd5a85 Mon Sep 17 00:00:00 2001 From: lucas_nz Date: Tue, 15 Sep 2020 07:19:52 +1200 Subject: large thumbs were being cropped a touch. as they could be wider than the parent div (especially when the window is small). changes to events.html add a little more room for the large thumb. changes to EventCtrl.js ensure the thumb is never wider than the thumb div. --- www/js/EventCtrl.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'www/js/EventCtrl.js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 64d2e724..4e1417f7 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -3389,27 +3389,30 @@ angular.module('zmApp.controllers') } var ld = NVR.getLogin(); var landscape = ($rootScope.devWidth > $rootScope.devHeight) ? true:false; - var maxRowHeight; + var maxThumbHeight; + var maxThumbWidth; if (ld.eventViewThumbsSize == 'large') { - maxRowHeight = Math.min(0.7* $rootScope.devHeight, 450); + maxThumbHeight = Math.min(0.7* $rootScope.devHeight, 450); + maxThumbWidth = Math.min(0.95* $rootScope.devWidth, $rootScope.devWidth - 44); if (landscape) { // go till 90% of width in large landscape, but restricted to useable row height - return calculateAspectRatioFit(mw, mh, 0.95* $rootScope.devWidth, maxRowHeight); + return calculateAspectRatioFit(mw, mh, maxThumbWidth, maxThumbHeight); } else { // go till 80% of width in large portrait, but restricted to useable row height - return calculateAspectRatioFit(mw, mh, 0.95* $rootScope.devWidth, maxRowHeight); + return calculateAspectRatioFit(mw, mh, maxThumbWidth, maxThumbHeight); } } else { // small - maxRowHeight = 250; + maxThumbHeight = 250; + maxThumbWidth = 0.5* $rootScope.devWidth; if (landscape) { // go till 50% of width in small landscape, but restricted to useable row height - return calculateAspectRatioFit(mw, mh, 0.5* $rootScope.devWidth, maxRowHeight); + return calculateAspectRatioFit(mw, mh, maxThumbWidth, maxThumbHeight); } else { // go till 30% of width in small portrait, but restricted to useable row height - return calculateAspectRatioFit(mw, mh, 0.5* $rootScope.devWidth, maxRowHeight); + return calculateAspectRatioFit(mw, mh, maxThumbWidth, maxThumbHeight); } } -- cgit v1.2.3