1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 04:45:18 +03:00

Universal Sliders for Settings framework

This commit is contained in:
Pawel Spychalski (DzikuVx) 2022-05-10 21:31:35 +02:00
parent 611b5895ec
commit 1d3ceacb14
3 changed files with 135 additions and 21 deletions

View file

@ -57,4 +57,10 @@ function generateFilename(prefix, suffix) {
+ zeroPad(date.getSeconds(), 2);
return filename + '.' + suffix;
}
}
function scaleRangeInt(x, srcMin, srcMax, destMin, destMax) {
let a = (destMax - destMin) * (x - srcMin);
let b = srcMax - srcMin;
return Math.round((a / b) + destMin);
}