]> git.webhop.me Git - shellexec.git/commitdiff
- fix detection of text background color
authorGetAway <get-away@t-online.de>
Sat, 3 Dec 2016 20:20:41 +0000 (21:20 +0100)
committersvenhoefer <svenhoefer@svenhoefer.com>
Sat, 3 Dec 2016 20:20:41 +0000 (21:20 +0100)
text.c

diff --git a/text.c b/text.c
index 3fc9bd256e9dd7a768c4349b5d41343252ab892c..d584191fd858d8aa8af4984df95478ac9f5acf73 100644 (file)
--- a/text.c
+++ b/text.c
@@ -287,7 +287,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                if (_sx + sbit->xadvance >= _ex)
                        return -1; /* limit to maxwidth */
 
-               uint32_t bgcolor = *(lbb + (starty + _sy) * stride + (startx + _sx));
+               uint32_t bgcolor = *(lbb + (starty + _sy - sbit->top) * stride + (startx + _sx));
                uint32_t fgcolor = bgra[color];
                uint32_t *colors = lookup_colors(fgcolor, bgcolor);
                uint32_t *p = lbb + (startx + _sx + sbit->left + kerning.x) + stride * (starty + _sy - sbit->top - _d);