From 103d7b2cee83a684a0785738ecb0bbbe639bfbe2 Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Fri, 28 Jul 2023 10:19:51 -0400 Subject: [PATCH] Another slight fix to button mid coords. --- simple-graphics.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simple-graphics.lua b/simple-graphics.lua index 3f11c7d..baf1650 100644 --- a/simple-graphics.lua +++ b/simple-graphics.lua @@ -80,8 +80,8 @@ 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+math.floor(w/2) - local midY = y+math.floor(h/2) + local midX = x+math.floor((w-1)/2) + local midY = y+math.floor((h-1)/2) lib.fillRect(m, x, y, w, h, bg) lib.drawTextCenter(m, midX, midY, text, fg) return {x1=x1,y1=y1,x2=x2,y2=y2}