Restore ability to use foreground color unchanged for selections

This commit is contained in:
Kovid Goyal
2021-12-06 05:23:41 +05:30
parent 2d66e37dcb
commit 6e351cd945
3 changed files with 15 additions and 5 deletions

View File

@@ -12,7 +12,7 @@
// Inputs {{{
layout(std140) uniform CellRenderData {
float xstart, ystart, dx, dy, sprite_dx, sprite_dy, background_opacity, use_cell_for_selection_fg, use_cell_for_selection_bg;
float xstart, ystart, dx, dy, sprite_dx, sprite_dy, background_opacity, use_cell_bg_for_selection_fg, use_cell_fg_for_selection_fg, use_cell_for_selection_bg;
uint default_fg, default_bg, highlight_fg, highlight_bg, cursor_fg, cursor_bg, url_color, url_style, inverted;
@@ -188,7 +188,8 @@ void main() {
float in_url = float((is_selected & TWO) >> 1);
decoration_fg = choose_color(in_url, color_to_vec(url_color), to_color(colors[2], fg_as_uint));
// Selection
vec3 selection_color = choose_color(use_cell_for_selection_fg, bg, color_to_vec(highlight_fg));
vec3 selection_color = choose_color(use_cell_bg_for_selection_fg, bg, color_to_vec(highlight_fg));
selection_color = choose_color(use_cell_fg_for_selection_fg, foreground, selection_color);
foreground = choose_color(float(is_selected & ONE), selection_color, foreground);
decoration_fg = choose_color(float(is_selected & ONE), selection_color, decoration_fg);
// Underline and strike through (rendered via sprites)