applied Jochen's drw_text patch, thanks

This commit is contained in:
Anselm R Garbe 2013-06-23 21:53:09 +02:00
parent 33a74489f0
commit b800a1d136
1 changed files with 1 additions and 1 deletions

2
drw.c
View File

@ -157,7 +157,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *tex
ty = y + (h / 2) - (th / 2) + drw->font->ascent; ty = y + (h / 2) - (th / 2) + drw->font->ascent;
tx = x + (h / 2); tx = x + (h / 2);
/* shorten text if necessary */ /* shorten text if necessary */
for(len = MIN(olen, sizeof buf); len && tex.w > w - tex.h; len--) for(len = MIN(olen, sizeof buf); len && (tex.w > w - tex.h || w < tex.h); len--)
drw_font_getexts(drw->font, text, len, &tex); drw_font_getexts(drw->font, text, len, &tex);
if(!len) if(!len)
return; return;