forked from len0rd/rockbox
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
This commit is contained in:
parent
7f1b49693c
commit
a6570b7d37
7 changed files with 432 additions and 107 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue