From: GetAway Date: Fri, 25 Nov 2016 21:56:26 +0000 (+0100) Subject: fix render char - limit max width X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=6263f98044d095b6cf248c3c3e507397b2e1bf17;p=shellexec.git fix render char - limit max width --- diff --git a/shellexec.c b/shellexec.c index 3e62d9c..08b223b 100644 --- a/shellexec.c +++ b/shellexec.c @@ -8,7 +8,7 @@ #include "io.h" #include "gfx.h" -#define SH_VERSION 1.34 +#define SH_VERSION 1.35 static char CFG_FILE[128]="/var/tuxbox/config/shellexec.conf"; diff --git a/text.c b/text.c index a8c0360..3fc9bd2 100644 --- a/text.c +++ b/text.c @@ -284,6 +284,9 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color) //render char if (color != -1) /* don't render char, return charwidth only */ { + if (_sx + sbit->xadvance >= _ex) + return -1; /* limit to maxwidth */ + uint32_t bgcolor = *(lbb + (starty + _sy) * stride + (startx + _sx)); uint32_t fgcolor = bgra[color]; uint32_t *colors = lookup_colors(fgcolor, bgcolor); @@ -304,8 +307,6 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color) p += stride; r += stride; } - if (_sx + sbit->xadvance >= _ex) - return -1; /* limit to maxwidth */ } //return charwidth