From: GetAway Date: Wed, 26 Apr 2017 16:47:45 +0000 (+0200) Subject: input: fix calculation of render limit X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=0049ac1f3872c644dff3845da94f59df41e4c9ab;p=input.git input: fix calculation of render limit --- diff --git a/input.c b/input.c index 1014ef0..f21d219 100644 --- a/input.c +++ b/input.c @@ -12,7 +12,7 @@ #define NCF_FILE "/var/tuxbox/config/neutrino.conf" #define BUFSIZE 1024 -#define I_VERSION 2.0 +#define I_VERSION 2.01 char FONT[128]="/share/fonts/neutrino.ttf"; diff --git a/inputd.c b/inputd.c index 3abf2d8..5aea372 100644 --- a/inputd.c +++ b/inputd.c @@ -421,7 +421,7 @@ const char kalp[12][6]={"+-*/","abc RenderBox(exs+xp*exsz+1, eys+5+yp*eysz+1, exs+(xp+1)*exsz-1, eys+(yp+1)*eysz-1, 0/*radius*/, (epos==i)?CMCS:CMC); *trnd=(mask && format[i]==NUM && IsNum(estr[i]))?'*':estr[i]; - RenderString(trnd, exs+xp*exsz+2, eys+yp*eysz+tys+7, exsz-2, CENTER, MED, (epos==i)?CMCST:(IsInput(format[i]))?CMCT:CMCIT); + RenderString(trnd, exs+xp*exsz, eys+yp*eysz+tys+7, exsz, CENTER, MED, (epos==i)?CMCST:(IsInput(format[i]))?CMCT:CMCIT); } memcpy(lfb, lbb, var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t)); diff --git a/text.c b/text.c index 83dd3bd..c66ee66 100644 --- a/text.c +++ b/text.c @@ -147,7 +147,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color) if(color != -1) /* don't render char, return charwidth only */ { - if (_sx + sbit->xadvance >= _ex) + if (_sx + sbit->xadvance > _ex + 5) return -1; /* limit to maxwidth */ uint32_t bgcolor = *(lbb + (sy + _sy - sbit->top) * stride + (sx + _sx)); uint32_t fgcolor = bgra[color];