Fix broken analyis for negative scale

This commit is contained in:
Wuzzy 2022-04-17 12:43:14 +02:00
parent f6a46c825f
commit 944a9269df

View File

@ -187,10 +187,16 @@ local analyze_noiseparams = function(noiseparams)
-- is always 0, so we don't need to calculate it
end
end
-- Offset and scale
-- Add offset and scale to min/max value (final step)
local min_value = np.offset + np.scale * o_min
local max_value = np.offset + np.scale * o_max
-- Bring the 2 values in the correct order
-- (min_value might be bigger for negative scale)
if min_value > max_value then
min_value, max_value = max_value, min_value
end
-- Calculate "wavelengths"
local axes = { "x", "y", "z" }
local waves = {}