10 years later #1

Merged
sthag merged 374 commits from development into main 2026-03-07 00:18:59 +01:00
Showing only changes of commit ee43638cbc - Show all commits

View file

@ -523,6 +523,22 @@ function capitalizeFirstLetter(text) {
return text.charAt(0).toUpperCase() + text.slice(1);
}
function mapRange(value, inMin, inMax, outMin, outMax, reverse = false, clamp = false) {
let min = outMin;
let max = outMax;
if (reverse) {
[min, max] = [max, min];
}
const mapped = (value - inMin) * (max - min) / (inMax - inMin) + min;
if (clamp) {
return Math.max(Math.min(min, max), Math.min(Math.max(min, max), mapped));
}
return mapped;
}
// CONCEPTS
// NOTE: Benutzt private Zuweisungen