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

diff --git a/text.c b/text.c
index c0f95942216b20e918705d88fb89b275795cfe20..f647870aeadcdc292e5a198c6296a26f004433aa 100644 (file)
--- a/text.c
+++ b/text.c
@@ -274,7 +274,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 + (sy + _sy) * stride + (sx + _sx));
+               uint32_t bgcolor = *(lbb + (sy + _sy - sbit->top) * stride + (sx + _sx));
                uint32_t fgcolor = bgra[color];
                uint32_t *colors = lookup_colors(fgcolor, bgcolor);
                uint32_t *p = lbb + (sx + _sx + sbit->left + kerning.x) + stride * (sy + _sy - sbit->top - _d);