mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Fix rendering of semi-transparent cursors
This commit is contained in:
@@ -134,7 +134,7 @@ vec4 calculate_premul_foreground_from_sprites(vec4 text_fg) {
|
||||
float combined_alpha = min(text_fg.a + strike_alpha, 1.0f);
|
||||
// Underline color might be different, so alpha blend
|
||||
vec4 ans = alpha_blend(vec4(text_fg.rgb, combined_alpha * effective_text_alpha), vec4(decoration_fg, underline_alpha * effective_text_alpha));
|
||||
return mix(ans, cursor_color_premult, cursor_alpha);
|
||||
return mix(ans, cursor_color_premult, cursor_alpha * cursor_color_premult.a);
|
||||
}
|
||||
|
||||
vec4 adjust_foreground_contrast_with_background(vec4 text_fg, vec3 bg) {
|
||||
|
||||
@@ -186,7 +186,7 @@ void main() {
|
||||
|
||||
// Cursor
|
||||
cursor_color_premult = vec4(color_to_vec(cursor_bg) * cursor_opacity, cursor_opacity);
|
||||
vec3 final_cursor_text_color = color_to_vec(cursor_fg);
|
||||
vec3 final_cursor_text_color = mix(foreground, color_to_vec(cursor_fg), cursor_opacity);
|
||||
foreground = choose_color(cell_data.has_block_cursor, final_cursor_text_color, foreground);
|
||||
decoration_fg = choose_color(cell_data.has_block_cursor, final_cursor_text_color, decoration_fg);
|
||||
cursor_pos = to_sprite_pos(cell_data.pos, cursor_fg_sprite_idx * uint(cell_data.has_cursor), ZERO, ZERO);
|
||||
|
||||
Reference in New Issue
Block a user