From d651584d7a550a507670d9e028ed1c9be5fae427 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 22 Sep 2017 22:28:47 +0200 Subject: Respect pixels! --- not/Camera.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/not/Camera.lua b/not/Camera.lua index 65395cb..f49b5be 100644 --- a/not/Camera.lua +++ b/not/Camera.lua @@ -29,9 +29,9 @@ end function Camera:transform (scale, ratio, vw, vh) local px, py = self:getPosition() local sx, sy = self:getShake() - local dx, dy = (px + sx) * ratio, (py + sy) * ratio + local dx, dy = math.floor((px + sx) * ratio), math.floor((py + sy) * ratio) - vw, vh = vw / scale / 2, vh / scale / 2 + vw, vh = math.floor(vw / scale / 2), math.floor(vh / scale / 2) love.graphics.scale(scale, scale) love.graphics.translate(vw - dx, vh - dy) -- cgit v1.1