Fix clamp undefined min/max

This commit is contained in:
Rob Garrison 2018-09-18 07:45:53 -05:00
parent 375e0ec448
commit 7fff670683

View File

@ -328,9 +328,8 @@ function configDialog(style) {
// Clamp input[type=number] to a valid range // Clamp input[type=number] to a valid range
function clampValue(value, va) { function clampValue(value, va) {
const min = typeof va.min === 'undefined' ? 0 : va.min; const max = isNumber(va.max) ? va.max : 100;
const max = typeof va.max === 'undefined' ? 100 : va.max; if (isNumber(va.min) && value < va.min) {
if (value < min) {
return min; return min;
} }
if (value > max) { if (value > max) {