Skip to content

Commit

Permalink
Merge pull request #56 from alesegdia/master
Browse files Browse the repository at this point in the history
fixing scale for camera:lockWindow
  • Loading branch information
vrld committed Nov 2, 2015
2 parents 7fb1142 + 00a3f9b commit 8440ee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function camera:lockWindow(x, y, x_min, x_max, y_min, y_max, smoother, ...)

-- transform displacement to movement in world coordinates
local c,s = cos(-self.rot), sin(-self.rot)
dx,dy = (c*dx - s*dy) * self.scale, (s*dx + c*dy) * self.scale
dx,dy = (c*dx - s*dy) / self.scale, (s*dx + c*dy) / self.scale

-- move
self:move((smoother or self.smoother)(dx,dy,...))
Expand Down

0 comments on commit 8440ee1

Please sign in to comment.