Fix vector-light.trim() (see 2abe666ce9)

This commit is contained in:
Matthias Richter 2014-03-03 23:00:23 +01:00
parent 2abe666ce9
commit e10fa66e60

View File

@ -116,7 +116,7 @@ end
-- ref.: http://blog.signalsondisplay.com/?p=336 -- ref.: http://blog.signalsondisplay.com/?p=336
local function trim(maxLen, x, y) local function trim(maxLen, x, y)
local s = maxLen * maxLen / len2(x, y) local s = maxLen * maxLen / len2(x, y)
s = s < 1 and 1 or math.sqrt(s) s = s > 1 and 1 or math.sqrt(s)
return x * s, y * s return x * s, y * s
end end