mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
grid: scroll reverse: hopefully done correct now
This commit is contained in:
parent
0e078f44b6
commit
0f76f4190a
1 changed files with 3 additions and 3 deletions
6
grid.c
6
grid.c
|
|
@ -316,7 +316,6 @@ grid_scroll_reverse_partial(struct grid *grid, int offset, int rows)
|
|||
{
|
||||
const int grid_rows = grid->scrolling_region.end - grid->scrolling_region.start;
|
||||
const int top_margin = grid->scrolling_region.start;
|
||||
const int bottom_margin = grid->rows - grid->scrolling_region.end;
|
||||
|
||||
if (rows >= grid_rows - offset) {
|
||||
assert(false && "todo");
|
||||
|
|
@ -325,9 +324,10 @@ grid_scroll_reverse_partial(struct grid *grid, int offset, int rows)
|
|||
|
||||
int cell_dst = (top_margin + offset + rows) * grid->cols;
|
||||
int cell_src = (top_margin + offset) * grid->cols;
|
||||
int cell_count = (grid_rows - bottom_margin - top_margin - offset - rows) * grid->cols;
|
||||
int cell_count = (grid_rows - offset - rows) * grid->cols;
|
||||
|
||||
LOG_DBG("moving %d cells from %d", cell_count, cell_src);
|
||||
LOG_DBG("moving %d lines from row %d to row %d", cell_count / grid->cols,
|
||||
cell_src / grid->cols, (top_margin + offset) / grid->cols);
|
||||
|
||||
const size_t bytes = cell_count * sizeof(grid->cells[0]);
|
||||
memmove(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue