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

diff --git a/gfx.c b/gfx.c
index 9059acc8c5b3a5f590e138a65a53b2557e4fd255..c1612f3c3c4c27e3aa989e1350ca97ab919ab640 100644 (file)
--- a/gfx.c
+++ b/gfx.c
@@ -19,12 +19,12 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
                printf("%s RenderBox called with dx < 0 (%d)\n", __plugin__, dxx);
                dxx=0;
        }
-       int dyy_max = var_screeninfo.yres - 20;
-       if (dyy > dyy_max)
+
+       int dyy_max = var_screeninfo.yres;
+       if (ssy + dyy > dyy_max)
        {
-               printf("%s RenderBox called with dy > %d (%d)\n", __plugin__, dyy_max, dyy); //FIXME
-               //*** Error in `msgbox': munmap_chunk(): invalid pointer: 0x31459008 *** //Nevis
-               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)
index 1560dbff26d38a7051c3b53ba25e9e3a6dbcf18c..d08c237762910dbc2e2c5ffee7a415c717efdd8a 100644 (file)
--- a/msgbox.c
+++ b/msgbox.c
@@ -17,7 +17,7 @@
        typeof (b) __b = (b); \
        __a > __b ? __a : __b; })
 
-#define M_VERSION 2.01
+#define M_VERSION 2.02
 
 #define NCF_FILE       "/var/tuxbox/config/neutrino.conf"
 #define HDF_FILE       "/tmp/.msgbox_hidden"
diff --git a/text.c b/text.c
index 8f8a2293fcf138c53970364fe8dca9b6a8f8cc10..4113bc1c86f7bbf8700a511c70abcd29fbd0be8a 100644 (file)
--- a/text.c
+++ b/text.c
@@ -275,7 +275,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 fgcolor;
-               uint32_t bgcolor = *(lbb + (sy + _sy - sbit->top) * stride + (sx + _sx));
+               uint32_t bgcolor = *(lbb + (sy + _sy - _d - 1) * stride + (sx + _sx + sbit->left));
                if ( color == -2) /* flash */
                        fgcolor = bgcolor;
                else    
@@ -290,8 +290,8 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                        for(pitch = 0; pitch < sbit->width; pitch++)
                        {
                                if (*s)
-                                               *q = colors[*s];
-                               q++, s++;
+                                       *q = colors[*s];
+                               q++; s++;
                                if (q > r)      /* we are past _ex */
                                        break;
                        }