Skip to content

Commit

Permalink
screen: clear padding of main-lines on resize
Browse files Browse the repository at this point in the history
The invisible padding during width reduction is not cleared as we clear
it when it gets visible again. However, if the line is pushed into
scrollback in between, it may get visible once the width is increases
again. Hence, clear padding of main-lines if screen-width is decreased.

Signed-off-by: David Herrmann <[email protected]>
  • Loading branch information
David Herrmann committed Oct 22, 2013
1 parent 68e64ec commit 4e71294
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tsm_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,19 +635,21 @@ int tsm_screen_resize(struct tsm_screen *con, unsigned int x,
}
}

/* clear expansion area */
/* clear expansion/padding area */
for (j = 0; j < con->line_num; ++j) {
i = 0;
if (j < con->size_y)
i = con->size_x;

for ( ; i < x; ++i)
/* main-lines may go into SB, so clear all cells */
for ( ; i < con->main_lines[j]->size; ++i)
cell_init(con, &con->main_lines[j]->cells[i]);

i = 0;
if (j < con->size_y)
i = con->size_x;

/* alt-lines never go into SB, only clear visible cells */
for ( ; i < x; ++i)
cell_init(con, &con->alt_lines[j]->cells[i]);
}
Expand Down

0 comments on commit 4e71294

Please sign in to comment.