optimize it a bit
This commit is contained in:
parent
9b2a67d044
commit
955d9d8e30
1 changed files with 4 additions and 2 deletions
|
@ -151,6 +151,8 @@ void font_draw(XftDraw *d, TextureText *t, Rect *position)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l = strlen(text->str); /* number of bytes */
|
||||||
|
|
||||||
if (t->shadow) {
|
if (t->shadow) {
|
||||||
if (t->tint >= 0) {
|
if (t->tint >= 0) {
|
||||||
c.color.red = 0;
|
c.color.red = 0;
|
||||||
|
@ -167,7 +169,7 @@ void font_draw(XftDraw *d, TextureText *t, Rect *position)
|
||||||
}
|
}
|
||||||
XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->offset,
|
XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->offset,
|
||||||
t->font->xftfont->ascent + y + t->offset,
|
t->font->xftfont->ascent + y + t->offset,
|
||||||
(FcChar8*)text->str, strlen(text->str));
|
(FcChar8*)text->str, l);
|
||||||
}
|
}
|
||||||
c.color.red = t->color->r | t->color->r << 8;
|
c.color.red = t->color->r | t->color->r << 8;
|
||||||
c.color.green = t->color->g | t->color->g << 8;
|
c.color.green = t->color->g | t->color->g << 8;
|
||||||
|
@ -177,6 +179,6 @@ void font_draw(XftDraw *d, TextureText *t, Rect *position)
|
||||||
|
|
||||||
XftDrawStringUtf8(d, &c, t->font->xftfont, x,
|
XftDrawStringUtf8(d, &c, t->font->xftfont, x,
|
||||||
t->font->xftfont->ascent + y,
|
t->font->xftfont->ascent + y,
|
||||||
(FcChar8*)text->str, strlen(text->str));
|
(FcChar8*)text->str, l);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue