scroll logic fixes

This commit is contained in:
p.kosyh 2009-11-12 11:42:40 +00:00
parent 7222c00417
commit 9492fc5ffb
2 changed files with 7 additions and 5 deletions

View file

@ -2141,9 +2141,9 @@ int game_loop(void)
if (select_ref(prev, 0) || select_ref(prev, 1)) {
if (opt_kbd == KBD_SMART) {
(prev)?game_scroll_pup():game_scroll_pdown();
select_ref(!prev, 1);
select_ref(prev, 0);
} else
select_ref(prev, 1);
select_ref(!prev, 0);
}
} else {
if (prev)

View file

@ -1955,16 +1955,18 @@ void txt_box_size(textbox_t tbox, int *w, int *h)
void txt_box_scroll_next(textbox_t tbox, int disp)
{
int off;
int off, h;
struct textbox *box = (struct textbox *)tbox;
struct line *line = box->line;
if (!line)
return;
if (box->lay->h - box->off < box->h)
txt_layout_real_size(box->lay, NULL, &h);
if (h - box->off < box->h)
return;
off = box->lay->h - box->off - box->h;
off = h - box->off - box->h;
if (disp > off)
disp = off;