From 0170a6b4ca19aa6e96181b173297fc992ff5760f Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Fri, 14 Oct 2022 14:05:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E5=A4=84=E7=90=86=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=98=AF=E6=BB=9A=E5=8A=A8=E8=80=8C=E6=98=AF=E7=BF=BB=E9=A1=B5?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/atp.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/source/arm11/atp.c b/source/arm11/atp.c index 6a8b53d..6b91f39 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -200,10 +200,8 @@ static void draw_options( int start_row, int start_idx, int option_cnt, int sele screen_clean(); \ if( idx_top < title_len ) \ { \ - uint8_t* title_data[2]; \ - title_data[0] = (uint8_t*)title; \ - title_data[1] = &title_offset[idx_top]; \ - container_paint( title_paint, (atp_callerdata_t)title_data, title_len-idx_top, idx_top ); \ + uint8_t* title_data[2] = {(uint8_t*)title, title_offset}; \ + container_paint( title_paint, (atp_callerdata_t)title_data, title_len, idx_top ); \ draw_options( title_len - idx_top, 0, cnt, item_sel, provider, data ); \ } \ else draw_options( 0, idx_top - title_len, cnt, item_sel, provider, data ); \ @@ -287,14 +285,10 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t else if( sel < 0 ) sel = (int)cnt-1; // 更新idx_top - int top = title_len + sel; + int sel_row = title_len + sel; + int top = sel_row - sel_row % CONTAINER_MAX_LINES; atp_boolean_t full_refresh = 0; - if( top >= idx_top + CONTAINER_MAX_LINES ) - { - idx_top = 1 + top - CONTAINER_MAX_LINES; - full_refresh = 1; - } - else if( top < idx_top ) + if( top != idx_top ) { idx_top = top; full_refresh = 1;