From 2ad8d492b5be9c8f0581dff73567a66e649c1f26 Mon Sep 17 00:00:00 2001 From: cha0s Date: Wed, 12 Jun 2024 19:39:40 -0500 Subject: [PATCH] fix: pixel rounding --- app/react-components/ecs.jsx | 5 ++++- app/react-components/sprite.jsx | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/react-components/ecs.jsx b/app/react-components/ecs.jsx index 29bd824..764c69d 100644 --- a/app/react-components/ecs.jsx +++ b/app/react-components/ecs.jsx @@ -38,7 +38,10 @@ export default function EcsComponent() { } const {Camera} = mainEntity; const {TileLayers} = ecs.get(1); - const [cx, cy] = [Camera.x - RESOLUTION.x / 2, Camera.y - RESOLUTION.y / 2]; + const [cx, cy] = [ + Math.round(Camera.x - RESOLUTION.x / 2), + Math.round(Camera.y - RESOLUTION.y / 2), + ]; return ( ); } \ No newline at end of file