bugfixes to graphics elements
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user