[added] vec2:new supports .x .y table argument

This commit is contained in:
Max Cahill 2020-03-18 21:22:11 +11:00
parent bb35fc2f57
commit 370aee6cbc

View File

@ -32,6 +32,8 @@ function vec2:new(x, y)
return x:copy() return x:copy()
elseif x[1] and x[2] then elseif x[1] and x[2] then
return vec2:xy(x[1], x[2]) return vec2:xy(x[1], x[2])
elseif x.x and x.y then
return vec2:xy(x.x, x.y)
end end
end end
end end