mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-31 22:32:45 +00:00
Merge branch 'fix_white_background_transparency' of https://github.com/Luflosi/kitty
This commit is contained in:
commit
a827f4190c
3 changed files with 10 additions and 3 deletions
|
|
@ -26,6 +26,9 @@ Changelog
|
|||
negative :opt:`wheel_scroll_multiplier` values in full-screen applications
|
||||
like vim (:iss:`1299`)
|
||||
|
||||
- Fix :opt:`background_opacity` not working with pure white backgrounds
|
||||
(:iss:`1285`)
|
||||
|
||||
0.13.2 [2019-01-04]
|
||||
------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -4,5 +4,5 @@ in vec3 color;
|
|||
out vec4 final_color;
|
||||
|
||||
void main() {
|
||||
final_color = vec4(color, background_opacity);
|
||||
final_color = vec4(color * background_opacity, background_opacity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,11 @@ vec4 calculate_foreground() {
|
|||
void main() {
|
||||
#ifdef BACKGROUND
|
||||
#ifdef TRANSPARENT
|
||||
final_color = vec4(background.rgb * bg_alpha, bg_alpha);
|
||||
// bg_alpha is doubled to match rendering in the SIMPLE case
|
||||
// and also rendering of the margin/padding, see https://github.com/kovidgoyal/kitty/pull/1291
|
||||
// to test use background_opacity, window_margin_width and icat to display
|
||||
// an image.
|
||||
final_color = vec4(background.rgb * bg_alpha * bg_alpha, bg_alpha);
|
||||
#else
|
||||
final_color = vec4(background.rgb, 1.0f);
|
||||
#endif
|
||||
|
|
@ -101,7 +105,7 @@ void main() {
|
|||
#else
|
||||
// SIMPLE
|
||||
#ifdef TRANSPARENT
|
||||
final_color = alpha_blend_premul(fg.rgb, fg.a, background, bg_alpha);
|
||||
final_color = alpha_blend_premul(fg.rgb, fg.a, background * bg_alpha, bg_alpha);
|
||||
final_color = vec4(final_color.rgb, final_color.a);
|
||||
#else
|
||||
// since background alpha is 1.0, it is effectively pre-multiplied
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue