From 1495c98f0b3172b53e79debf7b9d6049dbc9227c Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Sat, 3 Mar 2018 18:13:14 +0000 Subject: [PATCH] lualoader: Tweak positioning and fix an off-by-one - All of our default positions were offset from forth - Our menu frame size was smaller than in forth - Logo/brand drawing had an off-by-one, drawing one column lower on the screen than they should have been. - While here, switch a print() to printc() as it's expected that logos may contain color and other escpae sequences that we'll need to honor. --- stand/lua/drawer.lua | 18 +++++++++--------- stand/lua/menu.lua | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index a79c201da576..b4249a784c29 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -205,9 +205,9 @@ drawer.menu_name_handlers = { } drawer.brand_position = {x = 2, y = 1} -drawer.logo_position = {x = 46, y = 1} -drawer.menu_position = {x = 6, y = 11} -drawer.box_pos_dim = {x = 3, y = 10, w = 41, h = 11} +drawer.logo_position = {x = 46, y = 4} +drawer.menu_position = {x = 5, y = 10} +drawer.frame_size = {w = 42, h = 13} drawer.branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid @@ -337,10 +337,10 @@ function drawer.drawmenu(menudef) end function drawer.drawbox() - local x = drawer.box_pos_dim.x - local y = drawer.box_pos_dim.y - local w = drawer.box_pos_dim.w - local h = drawer.box_pos_dim.h + local x = drawer.menu_position.x - 3 + local y = drawer.menu_position.y - 1 + local w = drawer.frame_size.w + local h = drawer.frame_size.h local framestyle = loader.getenv("loader_menu_frame") or "double" local framespec = drawer.frame_styles[framestyle] @@ -404,8 +404,8 @@ end function drawer.draw(x, y, logo) for i = 1, #logo do - screen.setcursor(x, y + i) - print(logo[i]) + screen.setcursor(x, y + i - 1) + printc(logo[i]) end end diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 53c56c631123..098f34a4f72d 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -420,8 +420,8 @@ function menu.autoboot() end ab = tonumber(ab) or 10 - local x = loader.getenv("loader_menu_timeout_x") or 5 - local y = loader.getenv("loader_menu_timeout_y") or 22 + local x = loader.getenv("loader_menu_timeout_x") or 4 + local y = loader.getenv("loader_menu_timeout_y") or 23 local endtime = loader.time() + ab local time