emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fringe icon color is wrong on OSX


From: Bozhidar Batsov
Subject: Re: Fringe icon color is wrong on OSX
Date: Wed, 15 Jul 2015 08:53:58 +0300

I wondered why the fringe icons were looking so terrible for me on master. Thanks for the patch! I hope it will be merged soon.

On 15 July 2015 at 06:16, Feng Li <address@hidden> wrote:
Fringe icons have incorrect background and foreground colors in the git
master version of Emacs.

There are 2 issues:

1. The icon is drawn with background color instead of foreground color.

2. The icon background is opaque (and is in foreground color) instead of
being transparent.

I tracked it down to this commit:

67a878f * Honor :fore/background for XBM on NS (Bug#14969).

The attached patch fixes the fringe icon issue for me.  I haven't tested it
extensively with other XBM image use case though.


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;

--
Feng Li






reply via email to

[Prev in Thread] Current Thread [Next in Thread]