diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-04-16 19:42:28 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-04-16 19:42:28 -0400 |
commit | 04bb76dd50a8ae19f5ab333229edf1f3da92b933 (patch) | |
tree | 68e6a5e61beb4ace3e78ab404c83331315337e90 | |
parent | b42b118ec60f845c70baf721a26a7450656d0641 (diff) | |
download | runes-04bb76dd50a8ae19f5ab333229edf1f3da92b933.tar.gz runes-04bb76dd50a8ae19f5ab333229edf1f3da92b933.zip |
fix scrolling up
-rw-r--r-- | display.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -141,15 +141,19 @@ void runes_display_focus_out(RunesTerm *t) void runes_display_move_to(RunesTerm *t, int row, int col) { - int scroll = row - t->scroll_bottom; + int height = t->scroll_bottom - t->scroll_top; t->row = row + t->scroll_top; t->col = col; - if (scroll > 0) { - runes_display_scroll_down(t, scroll); + if (row > height) { + runes_display_scroll_down(t, row - height); t->row = t->scroll_bottom; } + else if (row < 0) { + runes_display_scroll_up(t, -row); + t->row = t->scroll_top; + } runes_display_position_cursor(t, t->cr); } |