Fix polygon rotation.

This commit is contained in:
Matthias Richter 2011-02-27 14:48:46 +01:00
parent 68af2448fd
commit 06ae1d0910

View File

@ -218,7 +218,7 @@ end
function Polygon:rotate(angle, center, cy)
local center = center or self.centroid
if cy then center = vector(cy) end
if cy then center = vector(center, cy) end
for i,v in ipairs(self.vertices) do
self.vertices[i] = (self.vertices[i] - center):rotate_inplace(angle) + center
end