mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Fix vector-light.trim() (see 2abe666ce9
)
This commit is contained in:
parent
2abe666ce9
commit
e10fa66e60
@ -116,7 +116,7 @@ end
|
||||
-- ref.: http://blog.signalsondisplay.com/?p=336
|
||||
local function trim(maxLen, 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
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user