From e14ef84422bb61210b7dfdc4067430962c5d3666 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Thu, 14 Mar 2024 17:13:55 -0500 Subject: [PATCH] Fix less precise grid snapping. --- TiledCollisionEditor/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TiledCollisionEditor/main.cpp b/TiledCollisionEditor/main.cpp index 081b993..10eb856 100644 --- a/TiledCollisionEditor/main.cpp +++ b/TiledCollisionEditor/main.cpp @@ -106,7 +106,7 @@ public: if(GetKey(CTRL).bHeld){ return vf2d{round(worldCoords.x),round(worldCoords.y)}; } - return vf2d{round(worldCoords.x/tileset.tilewidth)*tileset.tilewidth,round(worldCoords.y/tileset.tileheight)*tileset.tileheight}; + return vf2d{round(worldCoords.x/(tileset.tilewidth/4))*tileset.tilewidth/4,round(worldCoords.y/(tileset.tileheight/4))*tileset.tileheight/4}; }; if(EditingQuad){