diff --git a/src/sdl-instead/game.c b/src/sdl-instead/game.c index 5119d07..b189f01 100644 --- a/src/sdl-instead/game.c +++ b/src/sdl-instead/game.c @@ -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) diff --git a/src/sdl-instead/graphics.c b/src/sdl-instead/graphics.c index e1b01ab..0d99b6a 100644 --- a/src/sdl-instead/graphics.c +++ b/src/sdl-instead/graphics.c @@ -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;