mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-07 06:14:12 +08:00
尝试修正需要翻页的时候出现的宕机
This commit is contained in:
parent
91b5acd150
commit
89efdb0c8e
@ -196,14 +196,20 @@ static void draw_options( int start_row, int start_idx, int option_cnt, int sele
|
||||
}
|
||||
|
||||
#define SELECTED_ROW(top, len, sel) (((top) < (len)) ? ((len)-(top)+(sel)) : ((sel)+(len)-(top)))
|
||||
#define REFRESH_PAGE {\
|
||||
if( idx_top < title_len )\
|
||||
{\
|
||||
void *title_data[2] = {(void*)title, (void*)title_offset};\
|
||||
container_paint( title_paint, title_data, title_len-idx_top, 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 );\
|
||||
#define REFRESH_PAGE { \
|
||||
if( idx_top < title_len ) \
|
||||
{ \
|
||||
void *title_data[2]; \
|
||||
title_data[0] = (void*)title; \
|
||||
title_data[1] = &title_offset[idx_top]; \
|
||||
for( int i=0; i < idx_top; ++i ) \
|
||||
{ \
|
||||
title_data[0] = (void*)((atp_text_t)title_data[0] + title_offset[i]); \
|
||||
} \
|
||||
container_paint( title_paint, title_data, title_len-idx_top, 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 ); \
|
||||
}
|
||||
|
||||
atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t provider, atp_keyhandler_t handler, atp_callerdata_t data, atp_itemval_t *res )
|
||||
@ -226,6 +232,7 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t
|
||||
++title_len;
|
||||
cursor = next;
|
||||
}
|
||||
for( int i=title_len; i < TITLE_MAX; ++i ) title_offset[i] = 0;
|
||||
|
||||
// draw item
|
||||
draw_options( title_len, 0, cnt, item_sel, provider, data );
|
||||
|
Loading…
x
Reference in New Issue
Block a user