mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-01 07:15:32 -04:00
render: apply opacity correctly when in reverse video mode
This commit is contained in:
parent
5aa170b9f6
commit
a53e8c2866
2 changed files with 9 additions and 2 deletions
|
|
@ -45,6 +45,7 @@
|
||||||
speed too slow (https://codeberg.org/dnkl/foot/issues/144).
|
speed too slow (https://codeberg.org/dnkl/foot/issues/144).
|
||||||
* Crash when `foot.ini` contains an invalid section name
|
* Crash when `foot.ini` contains an invalid section name
|
||||||
(https://codeberg.org/dnkl/foot/issues/159).
|
(https://codeberg.org/dnkl/foot/issues/159).
|
||||||
|
* Background opacity when in _reverse video_ mode.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
10
render.c
10
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 fg = color_hex_to_pixman(_fg);
|
||||||
pixman_color_t bg = color_hex_to_pixman_with_alpha(
|
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)
|
if (cell->attrs.dim)
|
||||||
color_dim(&fg);
|
color_dim(&fg);
|
||||||
|
|
@ -549,8 +551,12 @@ render_margin(struct terminal *term, struct buffer *buf,
|
||||||
const int line_count = end_line - start_line;
|
const int line_count = end_line - start_line;
|
||||||
|
|
||||||
uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
|
uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
|
||||||
|
|
||||||
pixman_color_t bg = color_hex_to_pixman_with_alpha(
|
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)
|
if (term->is_searching)
|
||||||
color_dim(&bg);
|
color_dim(&bg);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue