From a6570b7d378b6236c40d2e2bd983f7d53ad479e3 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 5 Apr 2024 00:38:35 -0400 Subject: lua use lcd_drawline to draw lines inside rliimages rewrite draw_text to use new viewport buffer set_viewport now accepts rliimage to allowe interfacing with rb. functions fix long standing 2-bit bug with text drawing in lua fix 2-bit img saving bug (i'm guessing just a one off, just enabled clipping) fix font_getstringsize bug fix shape of numbers draw_num.lua also add auto centering add page scrolling to printtable add a new demo script 'stars' Change-Id: I866905cee82ee89ebc0eb020a56a7ecdb101bf5e --- apps/plugins/lua/include_lua/printtable.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apps/plugins/lua/include_lua/printtable.lua') diff --git a/apps/plugins/lua/include_lua/printtable.lua b/apps/plugins/lua/include_lua/printtable.lua index c70fc1343f..02f3935ae6 100644 --- a/apps/plugins/lua/include_lua/printtable.lua +++ b/apps/plugins/lua/include_lua/printtable.lua @@ -145,13 +145,14 @@ function print_table(t, t_count, settings) local wrap, justify, start, curpos, co_routine, hasheader, m_sel local header_fgc, header_bgc, item_fgc, item_bgc, item_selc - local table_linedesc, drawsep, overflow, dpad_fn + local table_linedesc, drawsep, overflow, dpad_fn, pagescroll do local s = settings or _print.get_settings() wrap, justify = s.wrap, s.justify start, curpos = s.start, s.curpos co_routine = s.co_routine hasheader = s.hasheader + pagescroll = s.pagescroll drawsep = s.drawsep sb_width = s.sb_width or sb_width m_sel = false @@ -234,8 +235,13 @@ function print_table(t, t_count, settings) dpad_fn(t_p.col, -1, -t_p.col_scrl, t_p.row, -1, -t_p.row_scrl, nil, overflow, (t_p.row + t_p.vcursor - 1)) + + if pagescroll == true then + t_p.row = t_p.row + y_chg * maxline - 1 + end t_p.vcursor = t_p.vcursor + y_chg + if t_p.vcursor > maxline or t_p.vcursor < t_p.vcursor_min then t_p.row = yi end @@ -268,6 +274,7 @@ function print_table(t, t_count, settings) elseif y_chg ~= 0 then --t_p.col = 0 -- reset column to the beginning _print.clear() + _print.opt.sel_line(t_p.vcursor) t_p.row_scrl = set_accel(timeb, t_p.row_scrl, t_p) -- cgit v1.2.3