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.
This commit is contained in:
IgorA100
2024-05-27 21:23:13 +03:00
committed by GitHub
parent 075bbfc244
commit 90ecbb8faf

View File

@@ -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) {