scroll fix
This commit is contained in:
parent
0b6ae0b94b
commit
1079748816
|
@ -2458,11 +2458,11 @@ static void scroll_up(int id, int count)
|
||||||
if (box_isscroll_up(id))
|
if (box_isscroll_up(id))
|
||||||
return;
|
return;
|
||||||
// game_highlight(-1, -1, 0);
|
// game_highlight(-1, -1, 0);
|
||||||
if (game_theme.gfx_mode == GFX_MODE_EMBEDDED)
|
// if (game_theme.gfx_mode == GFX_MODE_EMBEDDED)
|
||||||
txt_box_scroll(el_box(id), -(FONT_SZ(game_theme.font_size)) * count);
|
txt_box_scroll(el_box(id), -(FONT_SZ(game_theme.font_size)) * count);
|
||||||
else
|
// else
|
||||||
for (i = 0; i < count; i++)
|
// for (i = 0; i < count; i++)
|
||||||
txt_box_prev_line(el_box(id));
|
// txt_box_prev_line(el_box(id));
|
||||||
el_clear(id);
|
el_clear(id);
|
||||||
el_draw(id);
|
el_draw(id);
|
||||||
el_update(id);
|
el_update(id);
|
||||||
|
@ -2474,11 +2474,11 @@ static void scroll_down(int id, int count)
|
||||||
if (box_isscroll_down(id))
|
if (box_isscroll_down(id))
|
||||||
return;
|
return;
|
||||||
// game_highlight(-1, -1, 0);
|
// game_highlight(-1, -1, 0);
|
||||||
if (game_theme.gfx_mode == GFX_MODE_EMBEDDED)
|
// if (game_theme.gfx_mode == GFX_MODE_EMBEDDED)
|
||||||
txt_box_scroll(el_box(id), (FONT_SZ(game_theme.font_size)) * count);
|
txt_box_scroll(el_box(id), (FONT_SZ(game_theme.font_size)) * count);
|
||||||
else
|
// else
|
||||||
for (i = 0; i < count; i++)
|
// for (i = 0; i < count; i++)
|
||||||
txt_box_next_line(el_box(id));
|
// txt_box_next_line(el_box(id));
|
||||||
el_clear(id);
|
el_clear(id);
|
||||||
el_draw(id);
|
el_draw(id);
|
||||||
el_update(id);
|
el_update(id);
|
||||||
|
|
|
@ -3099,8 +3099,8 @@ void txt_box_scroll_next(textbox_t tbox, int disp)
|
||||||
|
|
||||||
off = box->off - line->y; /* offset from cur line */
|
off = box->off - line->y; /* offset from cur line */
|
||||||
off += disp; /* needed offset */
|
off += disp; /* needed offset */
|
||||||
while (line->next && off > line->h) {
|
while (line->next && off >= line->next->y - line->y) {
|
||||||
off -= line->h;
|
off -= (line->next->y - line->y);
|
||||||
line = line->next;
|
line = line->next;
|
||||||
}
|
}
|
||||||
box->line = line;
|
box->line = line;
|
||||||
|
@ -3122,7 +3122,7 @@ void txt_box_scroll_prev(textbox_t tbox, int disp)
|
||||||
|
|
||||||
while (line->prev && off < 0) {
|
while (line->prev && off < 0) {
|
||||||
line = line->prev;
|
line = line->prev;
|
||||||
off += line->h;
|
off += (line->next->y - line->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
box->line = line;
|
box->line = line;
|
||||||
|
|
Reference in a new issue