fix(menus): better cursor and widgets positionning

This commit is contained in:
Kazhnuz 2020-10-04 09:34:37 +02:00
parent d00bc782ba
commit a0c3dcea76
2 changed files with 3 additions and 3 deletions

View file

@ -51,7 +51,7 @@ end
function fancy.BaseWidget:drawCanvas()
love.graphics.draw(self.box, 0, 0)
local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) - 1
local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) - 2
self.font:draw(self.label, 16, h, -1, "left")
self.font:draw(self.label2, self.width -8, h, -1, "right")
end

View file

@ -81,7 +81,7 @@ end
function list.ListMenu:getCursorPosition()
local addition = MENU_ITEM_HEIGHT
local x = self.x + 6
local y = self.y + ((self.cursorTransition) * addition) - 1
local y = self.y + ((self.cursorTransition) * addition) + 1
return x, y
end
@ -122,7 +122,7 @@ function list.CenteredWidget:new(scene, menu_name, label)
end
function list.CenteredWidget:drawCanvas()
local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) - 1
local h = math.floor(self.height / 2) - (self.font:getHeight() / 2) - 2
self.font:draw(self.label, self.width / 2, h, -1, "center")
end