From 57bd502bb901a0470328292de603383afbf6dfe2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 26 May 2022 12:32:26 -0400 Subject: [PATCH] test for 0 before setting width and height --- web/js/MonitorStream.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/js/MonitorStream.js b/web/js/MonitorStream.js index 83ad5678f..675202d42 100644 --- a/web/js/MonitorStream.js +++ b/web/js/MonitorStream.js @@ -97,7 +97,7 @@ function MonitorStream(monitorData) { } stream_frame = $j('#monitor'+this.id); - if (((newscale == '0') || (newscale=='auto')) && (width=='auto')) { + if (((newscale == '0' || newscale == 0) || (newscale=='auto')) && (width=='auto' || !width)) { if (!this.bottomElement) { newscale = parseInt(100*monitor_frame.width() / this.width); // We don't want to change the existing css, cuz it might be 59% or 123px or auto; @@ -121,9 +121,9 @@ function MonitorStream(monitorData) { width = Math.round(parseInt(this.width) * newscale / 100)+'px'; height = Math.round(parseInt(this.height) * newscale / 100)+'px'; } - monitor_frame.css('width', width); - //img.style.width = width; - img.style.height = height; + if (width && width != '0px') monitor_frame.css('width', width); + if (height && height != '0px') img.style.height = height; + this.setStreamScale(newscale); }; // setscale