Change map_range behavior

This commit is contained in:
bri cassa 2023-12-20 23:31:34 +01:00
parent 6c150faaaf
commit caeff69f27

View File

@ -14,7 +14,9 @@ end
-- maps range of 0 to 1 to any other range
local function map_range(val, low, high)
return (val + low) * (high - low)
local cal_val = math.min(math.max(val, 0), 1)
local range = high - low
return low + (cal_val * range)
end
local function generate_effects(params)