From 90ecbb8faf013e1baa18aa285a80a68df01782ef Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Mon, 27 May 2024 21:23:13 +0300 Subject: [PATCH] Fix: scale calculation with "scale == 'fit_to_width'" watch.js If scale == 'fit_to_width', then it is necessary to take into account the width of the screen, not the monitor element, because The monitor has not yet reached the correct size. --- web/skins/classic/views/js/watch.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index ca15a6823..cb567d53b 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -1334,8 +1334,8 @@ function monitorsSetScale(id=null) { } else if (scale == 'fit_to_width') { //Fit to screen width resize = false; - width = parseInt(el.clientWidth * panZoomScale) + 'px'; - height = parseInt(el.clientHeight * panZoomScale) + 'px'; + width = parseInt(window.innerWidth * panZoomScale) + 'px'; + height = 'auto'; } if (resize) { @@ -1380,8 +1380,8 @@ function monitorsSetScale(id=null) { } else if (scale == 'fit_to_width') { //Fit to screen width resize = false; - width = parseInt(el.clientWidth * panZoomScale) + 'px'; - height = parseInt(el.clientHeight * panZoomScale) + 'px'; + width = parseInt(window.innerWidth * panZoomScale) + 'px'; + height = 'auto'; } if (resize) {