aboutsummaryrefslogtreecommitdiffstats
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/draw.c b/src/draw.c
index 3c7a59d..738c2db 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -412,9 +412,7 @@ void vega_draw(VegaGrid *grid, PureApp *app, const VegaScreen *screen, const cha
write_cstr(&head, count);
unsigned area = share - 1, visible = part->kind == VEGA_TABLE && area ? area - 1 : area;
size_t *first = &grid->first[i];
- if (focus < *first) *first = focus;
- if (visible && focus >= *first + visible) *first = focus - visible + 1;
- if (*first + visible > rows) *first = rows > visible ? rows - visible : 0;
+ *first = vega_scroll(*first, focus, visible, rows);
if (part->kind == VEGA_LIST) draw_list(grid, app, part, (int)i, *first, row + 1, area);
else draw_table(grid, app, part, (int)i, *first, row + 1, area);
row += share;