Added floor to button center coords.

This commit is contained in:
Andrew Lalis 2023-07-28 10:18:50 -04:00
parent 3f6060cbae
commit 5d54410bf0
1 changed files with 3 additions and 3 deletions

View File

@ -80,10 +80,10 @@ function lib.drawButton(m, x, y, w, h, text, fg, bg)
local y1 = y
local x2 = x+w-1
local y2 = y+h-1
local midX = x+(w/2)
local midY = y+(h/2)
local midX = x+math.floor(w/2)
local midY = y+math.floor(h/2)
lib.fillRect(m, x, y, w, h, bg)
lib.drawText(m, midX, midY, text, fg)
lib.drawTextCenter(m, midX, midY, text, fg)
return {x1=x1,y1=y1,x2=x2,y2=y2}
end