aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-08 17:53:11 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-11 17:24:50 +0000
commita53e8c28661f3267555a3e06ce7ef3b90a9cfbe1 (patch)
tree49a3ac19b10a2a4e11cab8712a587d2a97707c3f
parentdoc: foot.ini: the tweak section is called ‘tweak’, not ‘tweaks’ (diff)
render: apply opacity correctly when in reverse video mode
-rw-r--r--CHANGELOG.md1
-rw-r--r--render.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3bbc4fa4..66a8dc01 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,6 +45,7 @@
speed too slow (https://codeberg.org/dnkl/foot/issues/144).
* Crash when `foot.ini` contains an invalid section name
(https://codeberg.org/dnkl/foot/issues/159).
+* Background opacity when in _reverse video_ mode.
### Security
diff --git a/render.c b/render.c
index 210eaf47..20d66512 100644
--- a/render.c
+++ b/render.c
@@ -403,7 +403,9 @@ render_cell(struct terminal *term, pixman_image_t *pix,
pixman_color_t fg = color_hex_to_pixman(_fg);
pixman_color_t bg = color_hex_to_pixman_with_alpha(
- _bg, _bg == term->colors.bg ? term->colors.alpha : 0xffff);
+ _bg,
+ (_bg == (term->reverse ? term->colors.fg : term->colors.bg)
+ ? term->colors.alpha : 0xffff));
if (cell->attrs.dim)
color_dim(&fg);
@@ -549,8 +551,12 @@ render_margin(struct terminal *term, struct buffer *buf,
const int line_count = end_line - start_line;
uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
+
pixman_color_t bg = color_hex_to_pixman_with_alpha(
- _bg, _bg == term->colors.bg ? term->colors.alpha : 0xffff);
+ _bg,
+ (_bg == (term->reverse ? term->colors.fg : term->colors.bg)
+ ? term->colors.alpha : 0xffff));
+
if (term->is_searching)
color_dim(&bg);