Snapping mouse to grid

This commit is contained in:
Alexey 2025-05-20 09:31:19 +03:00
commit 74fdcd51f7
4 changed files with 29 additions and 11 deletions

View file

@ -30,7 +30,7 @@ function Grid:draw()
for x = 1, self.size.x do
for y = 1, self.size.y do
local px, py = x * Config.cellSize, y * Config.cellSize
love.graphics.circle( "fill", px, py, Config.pointRadius )
love.graphics.circle( "fill", px - Config.cellSize / 2, py - Config.cellSize / 2, Config.pointRadius)
end
end
end