The previous patch fixes the background color but there's another problem: the fringe bitmaps are left/right flipped.
I don't have time to track down to the root cause of these bugs but this new patch fixes both color and flipping for me.
0 git … diff
diff --git a/src/nsimage.m b/src/nsimage.m
index 9302cd2..33c355a 100644
--- a/src/nsimage.m
+++ b/src/nsimage.m
@@ -250,18 +250,19 @@ ns_set_alpha (void *img, int x, int y, unsigned char a)
c = *s++;
for (k = 0; i < w && k < 8; ++k, ++i)
{
- *alpha++ = 0xff;
- if (c & 1)
+ if ((c & 1) == 0)
{
*rr++ = fgr;
*gg++ = fgg;
*bb++ = fgb;
+ *alpha++ = 0xff;
}
else
{
*rr++ = bgr;
*gg++ = bgg;
*bb++ = bgb;
+ *alpha++ = 0;
}
idx++;
c >>= 1;
diff --git a/src/nsterm.m b/src/nsterm.m
index 2806f31..b7b7f93 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2321,7 +2321,15 @@ ns_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
unsigned char *cbits = xmalloc (len);
for (i = 0; i < len; i++)
- cbits[i] = ~(bits[i] & 0xff);
+ {
+ const static unsigned char lut[] = {
+ (~0x0)&0xf, (~0x8)&0xf, (~0x4)&0xf, (~0xc)&0xf,
+ (~0x2)&0xf, (~0xa)&0xf, (~0x6)&0xf, (~0xe)&0xf,
+ (~0x1)&0xf, (~0x9)&0xf, (~0x5)&0xf, (~0xd)&0xf,
+ (~0x3)&0xf, (~0xb)&0xf, (~0x7)&0xf, (~0xf)&0xf };
+ cbits[i] = (lut[bits[i]&0xf]<<4)|(lut[(bits[i]>>4)&0xf]);
+ // cbits[i] = ~(bits[i] & 0xff);
+ }
img = [[EmacsImage alloc] initFromXBM: cbits width: 8 height: p->h
fg: 0 bg: 0];
bimgs[p->which - 1] = img;