bugfixes to graphics elements

This commit is contained in:
Mikayla Fischler
2022-07-16 13:25:07 -04:00
parent 525dedb830
commit c3d6d900a1
5 changed files with 51 additions and 42 deletions

View File

@@ -24,13 +24,15 @@ local function push_button(args)
-- single line
args.height = 1
args.min_width = args.min_width or 0
local text_width = string.len(args.text)
args.width = math.max(text_width + 2, args.min_width)
-- create new graphics element base object
local e = element.new(args)
local h_pad = math.floor((e.frame.w - text_width) / 2)
local h_pad = math.floor((e.frame.w - text_width) / 2) + 1
local v_pad = math.floor(e.frame.h / 2) + 1
-- write the button text