Date: Sat, 3 Mar 2018 18:13:14 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330345 - head/stand/lua Message-ID: <201803031813.w23IDEqU066965@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Sat Mar 3 18:13:14 2018 New Revision: 330345 URL: https://svnweb.freebsd.org/changeset/base/330345 Log: 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. Modified: head/stand/lua/drawer.lua head/stand/lua/menu.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Mar 3 18:12:21 2018 (r330344) +++ head/stand/lua/drawer.lua Sat Mar 3 18:13:14 2018 (r330345) @@ -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 Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Sat Mar 3 18:12:21 2018 (r330344) +++ head/stand/lua/menu.lua Sat Mar 3 18:13:14 2018 (r330345) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803031813.w23IDEqU066965>