Fix nulling selection_fg not working
This commit is contained in:
parent
0c1a7347db
commit
28386cc496
@ -12,7 +12,7 @@
|
||||
|
||||
// Inputs {{{
|
||||
layout(std140) uniform CellRenderData {
|
||||
float xstart, ystart, dx, dy, sprite_dx, sprite_dy, background_opacity;
|
||||
float xstart, ystart, dx, dy, sprite_dx, sprite_dy, background_opacity, use_fg_for_selection;
|
||||
|
||||
uint default_fg, default_bg, highlight_fg, highlight_bg, cursor_fg, cursor_bg, url_color, url_style, inverted;
|
||||
|
||||
@ -189,7 +189,7 @@ void main() {
|
||||
decoration_fg = choose_color(in_url, color_to_vec(url_color), to_color(colors[2], fg_as_uint));
|
||||
#ifdef USE_SELECTION_FG
|
||||
// Selection
|
||||
vec3 selection_color = color_to_vec(highlight_fg);
|
||||
vec3 selection_color = choose_color(use_fg_for_selection, foreground, color_to_vec(highlight_fg));
|
||||
foreground = choose_color(float(is_selected & ONE), selection_color, foreground);
|
||||
decoration_fg = choose_color(float(is_selected & ONE), selection_color, decoration_fg);
|
||||
#endif
|
||||
|
||||
@ -276,7 +276,7 @@ pick_cursor_color(Line *line, ColorProfile *color_profile, color_type cell_fg, c
|
||||
static void
|
||||
cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, GLfloat xstart, GLfloat ystart, GLfloat dx, GLfloat dy, CursorRenderInfo *cursor, bool inverted, OSWindow *os_window) {
|
||||
struct CellRenderData {
|
||||
GLfloat xstart, ystart, dx, dy, sprite_dx, sprite_dy, background_opacity;
|
||||
GLfloat xstart, ystart, dx, dy, sprite_dx, sprite_dy, background_opacity, use_fg_for_selection;
|
||||
|
||||
GLuint default_fg, default_bg, highlight_fg, highlight_bg, cursor_fg, cursor_bg, url_color, url_style, inverted;
|
||||
|
||||
@ -292,7 +292,10 @@ cell_update_uniform_block(ssize_t vao_idx, Screen *screen, int uniform_buffer, G
|
||||
}
|
||||
#define COLOR(name) colorprofile_to_color(screen->color_profile, screen->color_profile->overridden.name, screen->color_profile->configured.name).rgb
|
||||
#define IS_SPECIAL_COLOR(name) (screen->color_profile->overridden.name.type == COLOR_IS_SPECIAL || (screen->color_profile->overridden.name.type == COLOR_NOT_SET && screen->color_profile->configured.name.type == COLOR_IS_SPECIAL))
|
||||
rd->default_fg = COLOR(default_fg); rd->default_bg = COLOR(default_bg); rd->highlight_fg = COLOR(highlight_fg); rd->highlight_bg = COLOR(highlight_bg);
|
||||
rd->default_fg = COLOR(default_fg); rd->default_bg = COLOR(default_bg);
|
||||
rd->highlight_fg = COLOR(highlight_fg); rd->highlight_bg = COLOR(highlight_bg);
|
||||
// selection
|
||||
rd->use_fg_for_selection = IS_SPECIAL_COLOR(highlight_fg) ? 1. : 0.;
|
||||
// Cursor position
|
||||
enum { BLOCK_IDX = 0, BEAM_IDX = 6, UNDERLINE_IDX = 7, UNFOCUSED_IDX = 8 };
|
||||
if (cursor->is_visible) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user