Fix incorrect text-antialiasing when using very low background opacity

Fix #1005
This commit is contained in:
Kovid Goyal 2018-11-22 10:26:40 +05:30
parent 4ceb4cfc22
commit 074614bc8e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -86,6 +86,9 @@ Changelog
- Add a terminfo entry for full keyboard mode.
- Fix incorrect text-antialiasing when using very low background opacity
(:iss:`1005`)
0.12.3 [2018-09-29]
------------------------------

View File

@ -102,7 +102,7 @@ void main() {
// SIMPLE
#ifdef TRANSPARENT
final_color = alpha_blend_premul(fg.rgb, fg.a, background * bg_alpha, bg_alpha);
final_color = vec4(final_color.rgb / final_color.a, final_color.a);
final_color = vec4(final_color.rgb, final_color.a);
#else
// since background alpha is 1.0, it is effectively pre-multiplied
final_color = vec4(premul_blend(fg.rgb, fg.a, background), 1.0f);