Fixes to function converting from pixels to percent. Adjust to 100 if > 100.
This commit is contained in:
parent
efec1e7d4f
commit
d0c21995cd
|
@ -178,14 +178,20 @@ function applyPreset() {
|
||||||
function toPixels(field, maxValue) {
|
function toPixels(field, maxValue) {
|
||||||
if ( field.value != '' ) {
|
if ( field.value != '' ) {
|
||||||
field.value = Math.round((field.value*maxValue)/100);
|
field.value = Math.round((field.value*maxValue)/100);
|
||||||
|
if ( field.value > maxValue )
|
||||||
|
field.value = maxValue;
|
||||||
}
|
}
|
||||||
field.setAttribute('step', 1);
|
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) {
|
function toPercent(field, maxValue) {
|
||||||
if ( field.value != '' ) {
|
if ( field.value != '' ) {
|
||||||
field.value = Math.round((100*100*field.value)/maxValue)/100;
|
field.value = Math.round((100*100*field.value)/maxValue)/100;
|
||||||
|
if ( field.value > 100 ) {
|
||||||
|
field.value = 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
field.setAttribute('step', 0.01);
|
field.setAttribute('step', 0.01);
|
||||||
field.setAttribute('max', 100);
|
field.setAttribute('max', 100);
|
||||||
|
@ -676,7 +682,6 @@ var watchdogFunctions = {
|
||||||
//Make sure the various refreshes are still taking effect
|
//Make sure the various refreshes are still taking effect
|
||||||
function watchdogCheck(type) {
|
function watchdogCheck(type) {
|
||||||
if ( watchdogInactive[type] ) {
|
if ( watchdogInactive[type] ) {
|
||||||
console.log("Detected streamWatch of type: " + type + " stopped, restarting");
|
|
||||||
watchdogFunctions[type]();
|
watchdogFunctions[type]();
|
||||||
watchdogInactive[type] = false;
|
watchdogInactive[type] = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue