From: GetAway Date: Tue, 11 Jul 2017 16:59:34 +0000 (+0200) Subject: fix detect of bgcolor and thus also rendering of italic fonts X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=796ac4d5580869fffd7545745d8a329ee364bfaf;p=msgbox.git fix detect of bgcolor and thus also rendering of italic fonts --- diff --git a/gfx.c b/gfx.c index 9059acc..c1612f3 100644 --- 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) diff --git a/msgbox.c b/msgbox.c index 1560dbf..d08c237 100644 --- 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 8f8a229..4113bc1 100644 --- 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; }