diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-05-04 19:12:24 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-05-04 19:12:24 -0400 |
commit | 270d383f9fa721bf910235625c77c6ce9245df7e (patch) | |
tree | 280521411f19fdbfe5fa22d5d78f4601d5b2a0d0 | |
parent | c48544e613903c617c1318b1f1cc4d7eae9daa47 (diff) | |
download | runes-270d383f9fa721bf910235625c77c6ce9245df7e.tar.gz runes-270d383f9fa721bf910235625c77c6ce9245df7e.zip |
draw the cursor in the right place when scrolling
-rw-r--r-- | src/display.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/display.c b/src/display.c index 8ecce16..71fb9df 100644 --- a/src/display.c +++ b/src/display.c @@ -118,7 +118,8 @@ void runes_display_draw_cursor(RunesTerm *t, cairo_t *cr) cairo_set_line_width(cr, 1); cairo_rectangle( cr, - col * t->fontx + 0.5, row * t->fonty + 0.5, + col * t->fontx + 0.5, + (row + t->scr.row_visible_offset) * t->fonty + 0.5, t->fontx, t->fonty); cairo_stroke(cr); } @@ -127,12 +128,14 @@ void runes_display_draw_cursor(RunesTerm *t, cairo_t *cr) cairo_rectangle( cr, - col * t->fontx, row * t->fonty, + col * t->fontx, + (row + t->scr.row_visible_offset) * t->fonty, t->fontx, t->fonty); cairo_fill(cr); runes_display_draw_glyph( t, cr, t->config.bgdefault, cell->attrs, - cell->contents, cell->len, row, col); + cell->contents, cell->len, + row + t->scr.row_visible_offset, col); } cairo_restore(cr); } |