diff --git a/docs/changelog.rst b/docs/changelog.rst index 5896932e1..3adf9b461 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -70,7 +70,7 @@ To update |kitty|, :doc:`follow the instructions `. - Improve handling of infinite length ligatures in newer versions of FiraCode and CascadiaCode. Now such ligatures are detected based on glyph naming - convention, this removes the gap in the ligatures at cell boundaries (:iss:`2695`) + convention. This removes the gap in the ligatures at cell boundaries (:iss:`2695`) 0.19.3 [2020-12-19] diff --git a/kitty/fonts.c b/kitty/fonts.c index 934ee9d24..074f35932 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -667,9 +667,10 @@ render_alpha_mask(uint8_t *alpha_mask, pixel* dest, Region *src_rect, Region *de pixel *d = dest + dest_stride * dr; uint8_t *s = alpha_mask + src_stride * sr; for(size_t sc = src_rect->left, dc = dest_rect->left; sc < src_rect->right && dc < dest_rect->right; sc++, dc++) { - pixel val = d[dc]; + uint8_t src_alpha = d[dc] & 0xff; uint8_t alpha = s[sc]; - d[dc] = 0xffffff00 | MIN(0xffu, alpha + (val & 0xff)); + uint8_t combined_alpha = MAX(alpha, src_alpha); + d[dc] = 0xffffff00 | MIN(0xffu, combined_alpha); } } }