summaryrefslogtreecommitdiff
path: root/libcons/vcons-refresh.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcons/vcons-refresh.c')
-rw-r--r--libcons/vcons-refresh.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libcons/vcons-refresh.c b/libcons/vcons-refresh.c
index 34f0de88..35e74224 100644
--- a/libcons/vcons-refresh.c
+++ b/libcons/vcons-refresh.c
@@ -37,21 +37,25 @@ cons_vcons_refresh (vcons_t vcons)
vcons->state.changes.written = vcons->display->changes.written;
cons_vcons_write (vcons, vcons->state.screen.matrix
- + vcons->state.screen.cur_line * vcons->state.screen.width,
- ((vcons->state.screen.lines - vcons->state.screen.cur_line
+ + (vcons->state.screen.cur_line % vcons->state.screen.lines)
+ * vcons->state.screen.width,
+ ((vcons->state.screen.lines
+ - (vcons->state.screen.cur_line % vcons->state.screen.lines)
< vcons->state.screen.height)
- ? vcons->state.screen.lines - vcons->state.screen.cur_line
+ ? vcons->state.screen.lines
+ - (vcons->state.screen.cur_line % vcons->state.screen.lines)
: vcons->state.screen.height)
* vcons->state.screen.width, 0, 0);
- if (vcons->state.screen.lines - vcons->state.screen.cur_line
+ if (vcons->state.screen.lines
+ - (vcons->state.screen.cur_line % vcons->state.screen.lines)
< vcons->state.screen.height)
cons_vcons_write (vcons, vcons->state.screen.matrix,
vcons->state.screen.height * vcons->state.screen.width
- (vcons->state.screen.lines
- - vcons->state.screen.cur_line)
+ - (vcons->state.screen.cur_line % vcons->state.screen.lines))
* vcons->state.screen.width, 0,
vcons->state.screen.lines
- - vcons->state.screen.cur_line);
+ - (vcons->state.screen.cur_line % vcons->state.screen.lines));
cons_vcons_set_cursor_pos (vcons, vcons->state.cursor.col,
vcons->state.cursor.row);