From 85e1db4fcb8792bc31a15e9192fcb3fb55d02a58 Mon Sep 17 00:00:00 2001 From: GetAway Date: Sat, 3 Dec 2016 21:20:41 +0100 Subject: [PATCH] - fix detection of text background color --- text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text.c b/text.c index 3fc9bd2..d584191 100644 --- 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); -- 2.39.5