diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-07-05 18:36:03 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-07-05 18:36:03 +0000 |
| commit | 77e349d20dd86469a44d095141bc2ce6feb9446f (patch) | |
| tree | 04665714ff0922d0f08633f38cb697d1bccee5b2 | |
| parent | csi: implement reverse video (diff) | |
render: reverse video only reverses the default background/foreground
| -rw-r--r-- | render.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -88,15 +88,11 @@ grid_render_update(struct terminal *term, struct buffer *buf, const struct damag int height = term->cell_height; struct rgba foreground = cell->attrs.have_foreground - ? cell->attrs.foreground : term->foreground; + ? cell->attrs.foreground + : !term->reverse ? term->foreground : term->background; struct rgba background = cell->attrs.have_background - ? cell->attrs.background : term->background; - - if (term->reverse) { - struct rgba swap = foreground; - foreground = background; - background = swap; - } + ? cell->attrs.background + : !term->reverse ? term->background : term->foreground; if (has_cursor) { struct rgba swap = foreground; |
