render: fix inversed cursor fg color when alpha != 1.0, take #2

No need to check if terminal colors have been reversed - this is done
by the cell rendering logic.

This hopefully fixes all remaining issues with invisible text when
background alpha < 1.0
This commit is contained in:
Daniel Eklöf 2023-02-28 17:49:57 +01:00
parent 7a43737745
commit 8a849b4b08
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -419,14 +419,13 @@ cursor_colors_for_cell(const struct terminal *term, const struct cell *cell,
}
} else {
*cursor_color = *fg;
*text_color = *bg;
if (unlikely(text_color->alpha != 0xffff)) {
/* We *know* this only happens when bg is the default bg
* color */
*text_color = color_hex_to_pixman(
term->reverse ^ is_selected ? term->colors.fg : term->colors.bg);
} else
*text_color = *bg;
/* The *only* color that can have transparency is the
* default background color */
*text_color = color_hex_to_pixman(term->colors.bg);
}
}
}