1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 11:17:15 +03:00

fix black pixel "halo"

Need to only set alpha to 1 if the pixel is not transparent

closes: #1110
This commit is contained in:
Wez Furlong 2021-09-06 09:31:50 -07:00
parent 05fc55a128
commit 3f212012f2

View File

@ -134,7 +134,7 @@ impl FreeTypeRasterizer {
rgba[dest_offset + (x * 4)] = gray;
rgba[dest_offset + (x * 4) + 1] = gray;
rgba[dest_offset + (x * 4) + 2] = gray;
rgba[dest_offset + (x * 4) + 3] = 0xff;
rgba[dest_offset + (x * 4) + 3] = if gray == 0 { 0 } else { 0xff };
}
}
RasterizedGlyph {
@ -177,7 +177,7 @@ impl FreeTypeRasterizer {
rgba[dest_offset + (x * 4)] = red;
rgba[dest_offset + (x * 4) + 1] = green;
rgba[dest_offset + (x * 4) + 2] = blue;
rgba[dest_offset + (x * 4) + 3] = 0xff;
rgba[dest_offset + (x * 4) + 3] = if red | green | blue == 0 { 0 } else { 0xff };
}
}