Skip to content

Commit

Permalink
Proper fix for always drawing borders opaque
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 25, 2024
1 parent b854589 commit cb13233
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kitty/border_vertex.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ void main() {
float is_window_bg = is_integer_value(rc, 3.);
float is_default_bg = is_integer_value(rc, 0.);
color3 = is_window_bg * window_bg + (1. - is_window_bg) * color3;
// Border must be always drawn opaque
float is_border_bg = 1. - step(0.5, abs((float(rc) - 2.) * (float(rc) - 1.))); // 1 if rc in (1, 2) else 0
float final_opacity = is_default_bg * tint_opacity + (1. - is_default_bg) * background_opacity;
final_opacity = is_border_bg + (1. - is_border_bg) * final_opacity;
float final_premult_opacity = is_default_bg * tint_premult + (1. - is_default_bg) * background_opacity;
final_premult_opacity = is_border_bg + (1. - is_border_bg) * final_premult_opacity;
color = vec4(color3 * final_premult_opacity, final_opacity);
}

0 comments on commit cb13233

Please sign in to comment.