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

@ -38,6 +38,10 @@ function Line:draw()
love.graphics.circle( "fill", sx, sy, Config.linePointRadius )
local ex, ey = self.endpoint:globalCoords()
love.graphics.circle( "fill", ex, ey, Config.linePointRadius )
if #self.points == 1 then
love.graphics.setColor( Color.white )
return
end
-- Draw line
local points = {}
for _, point in ipairs( self.points ) do