Skip to content

Commit

Permalink
Merge pull request #32 from stfan/patch-1
Browse files Browse the repository at this point in the history
Fix vector:trim_inplace()
  • Loading branch information
vrld committed Mar 3, 2014
2 parents e6ca809 + 65cef0e commit 2abe666
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vector.lua
Expand Up @@ -169,7 +169,7 @@ end
-- ref.: http://blog.signalsondisplay.com/?p=336
function vector:trim_inplace(maxLen)
local s = maxLen * maxLen / self:len2()
s = s < 1 and 1 or math.sqrt(s)
s = (s > 1 and 1) or math.sqrt(s)
self.x, self.y = self.x * s, self.y * s
return self
end
Expand Down

0 comments on commit 2abe666

Please sign in to comment.