Fixes to function converting from pixels to percent. Adjust to 100 if > 100.

This commit is contained in:
Isaac Connor 2020-08-09 22:19:43 -04:00
parent efec1e7d4f
commit d0c21995cd
1 changed files with 7 additions and 2 deletions

View File

@ -178,14 +178,20 @@ function applyPreset() {
function toPixels(field, maxValue) {
if ( field.value != '' ) {
field.value = Math.round((field.value*maxValue)/100);
if ( field.value > maxValue )
field.value = maxValue;
}
field.setAttribute('step', 1);
field.setAttribute('max', monitorArea);
field.setAttribute('max', maxValue);
}
// maxValue is the max Pixels value which is normally the max area
function toPercent(field, maxValue) {
if ( field.value != '' ) {
field.value = Math.round((100*100*field.value)/maxValue)/100;
if ( field.value > 100 ) {
field.value = 100;
}
}
field.setAttribute('step', 0.01);
field.setAttribute('max', 100);
@ -676,7 +682,6 @@ var watchdogFunctions = {
//Make sure the various refreshes are still taking effect
function watchdogCheck(type) {
if ( watchdogInactive[type] ) {
console.log("Detected streamWatch of type: " + type + " stopped, restarting");
watchdogFunctions[type]();
watchdogInactive[type] = false;
} else {