minmax util function

This commit is contained in:
Azgaar 2021-10-10 17:59:27 +03:00
parent b202a58db9
commit bdc0c9f8ee
13 changed files with 54 additions and 44 deletions

View file

@ -122,7 +122,7 @@ function pressNumpadSign(key) {
else if (religionsManuallyBrush.offsetParent) brush = document.getElementById("religionsManuallyBrush");
if (brush) {
const value = Math.max(Math.min(+brush.value + change, +brush.max), +brush.min);
const value = minmax(+brush.value + change, +brush.min, +brush.max);
brush.value = document.getElementById(brush.id + "Number").value = value;
return;
}