aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-04-05 10:15:18 -0400
committeriamcheeseman <[email protected]>2026-04-05 10:15:18 -0400
commit779fc71a8be224c22c7e650983d7af4c06854138 (patch)
treead0ab9ebe353af663ab54c560a55ab34e8ad217d
parent5c5e9adcae6333b4048c874c2abc7ea9ecb6ef94 (diff)
fix: round camera position when drawing
If we don't round the camera position, it can cause jittering since things are no longer drawn at a rounded position.
-rw-r--r--src/camera.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/camera.lua b/src/camera.lua
index 3283c0c..31bfe9e 100644
--- a/src/camera.lua
+++ b/src/camera.lua
@@ -36,6 +36,6 @@ function use_camera_transform()
local w, h = SCR_WIDTH / 2, SCR_HEIGHT / 2
lg.scale(active_cam.zoom)
lg.translate(
- -active_cam.realx + w / active_cam.zoom,
- -active_cam.realy + h / active_cam.zoom)
+ round(-active_cam.realx + w / active_cam.zoom),
+ round(-active_cam.realy + h / active_cam.zoom))
end