From cb13233606db098fb7bb0dbe8d7c943b7b1c88c2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 26 Sep 2024 00:08:36 +0530 Subject: [PATCH] Proper fix for always drawing borders opaque --- kitty/border_vertex.glsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kitty/border_vertex.glsl b/kitty/border_vertex.glsl index 4a74b50b2..4d9647c03 100644 --- a/kitty/border_vertex.glsl +++ b/kitty/border_vertex.glsl @@ -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); }