File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,11 +135,14 @@ void draw_cursor_up(unsigned int *file_current_offset, byte *file) {
135135
136136void draw_cursor_down (unsigned int * file_current_offset , byte * file ) {
137137
138- unsigned int maxy = getmaxy (hex );
139- unsigned int cur_y = getcury (hex );
140- unsigned int cur_x = getcurx (hex );
141- unsigned int hex_per_line = getmaxx (hex ) / 3 ;
142- if (maxy - 1 == cur_y ) {
138+ int maxy = getmaxy (hex );
139+ int cur_y = getcury (hex );
140+ int cur_x = getcurx (hex );
141+ int hex_per_line = getmaxx (hex ) / 3 ;
142+
143+ int down_max_count = strlen (file ) / hex_per_line - ((int ) * file_current_offset ) / hex_per_line - getmaxy (hex );
144+
145+ if (maxy - 1 == cur_y && down_max_count >= 0 ) {
143146 * file_current_offset += hex_per_line ;
144147 gui_draw_hex (file , * file_current_offset );
145148 wmove (hex , cur_y - 1 , cur_x );
You can’t perform that action at this time.
0 commit comments