]> git.webhop.me Git - shellexec.git/commitdiff
fix render char - limit max width
authorGetAway <get-away@t-online.de>
Fri, 25 Nov 2016 21:56:26 +0000 (22:56 +0100)
committersvenhoefer <svenhoefer@svenhoefer.com>
Sat, 26 Nov 2016 11:51:40 +0000 (12:51 +0100)
shellexec.c
text.c

index 3e62d9ca337a20abd751caf6268d315fcfa02c88..08b223b3b93f1b9a09e46b5f06a46f0282464c24 100644 (file)
@@ -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 a8c0360494aec5ac8866e47fae0fa7b8e30fddb7..3fc9bd256e9dd7a768c4349b5d41343252ab892c 100644 (file)
--- 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