]> git.webhop.me Git - shellexec.git/commitdiff
fix detect of bgcolor and thus also rendering of italic fonts
authorGetAway <get-away@t-online.de>
Tue, 11 Jul 2017 17:01:02 +0000 (19:01 +0200)
committerJacek Jendrzej <satbaby@kawaii.com>
Wed, 12 Jul 2017 14:01:57 +0000 (16:01 +0200)
gfx.c
shellexec.c
text.c

diff --git a/gfx.c b/gfx.c
index 20e6267226a50a1b6060321d7ad3d4a0efbcc7b7..8450739ac3c03d69a8df682f49723a3253f6b2dd 100644 (file)
--- a/gfx.c
+++ b/gfx.c
@@ -22,6 +22,13 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
                dxx=0;
        }
 
+       int dyy_max = var_screeninfo.yres;
+       if (ssy + dyy > dyy_max)
+       {
+               printf("[%s] %s called with height = %d (max. %d)\n", __plugin__, __func__, ssy + dyy, dyy_max);
+               dyy = dyy_max - ssy;
+       }
+
        if(R)
        {
                if(--dyy<=0)
index 4cfa74ddb46a78c29a2deefbf0c286929c6b8b9f..8da836b2729f3f30a4e8f4ee63d9052740720297 100644 (file)
@@ -12,7 +12,7 @@
 #include "pngw.h"
 
 
-#define SH_VERSION 2.02
+#define SH_VERSION 2.03
 
 static char CFG_FILE[128]="/var/tuxbox/config/shellexec.conf";
 
diff --git a/text.c b/text.c
index 3d6eec76096dfe6ba2a38456a04dd5e1a91c4b2e..2d9661d91ab4284debe985144e5c9b91510f896f 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 - sbit->top) * stride + (startx + _sx));
+               uint32_t bgcolor = *(lbb + (starty + _sy - _d - 1) * stride + (startx + _sx + sbit->left));
                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);
@@ -300,7 +300,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                        {
                                if (*s)
                                        *q = colors[*s];
-                               q++, s++;
+                               q++; s++;
                                if (q > r)      /* we are past _ex */
                                        break;
                        }