aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-06-26 17:44:31 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-06-26 17:44:31 +0000
commit3a97fce6d06dea35211191237a6ad3c2d41e5d31 (patch)
tree0ed6a0ec8928ca1cbb8332dc2ea44f7e1bcf87ab /grid.c
parentscroll: let the render erase the scrolled up region (diff)
grid: attributes now track whether we've set a foreground/background color
This means we don't have to explicitly set the foreground/background to the grid's default colors whenever we reset/clear a cell, and we can instead simply memset() the entire cell to 0. This also means the renderer has to get the default color when rendering a cell without a foreground/background color set.
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/grid.c b/grid.c
index 2663952d..a6ed618b 100644
--- a/grid.c
+++ b/grid.c
@@ -187,14 +187,6 @@ grid_erase(struct grid *grid, int start, int end)
{
assert(end >= start);
memset(&grid->cells[start], 0, (end - start) * sizeof(grid->cells[0]));
-
- for (int i = start; i < end; i++) {
- struct cell *cell = &grid->cells[i];
-
- cell->attrs.foreground = grid->foreground;
- cell->attrs.background = grid->background;
- }
-
grid_damage_erase(grid, start, end - start);
}