]> git.armaanb.net Git - dwm.git/commitdiff
applied Jochen's drw_text patch, thanks
authorAnselm R Garbe <anselm@garbe.us>
Sun, 23 Jun 2013 19:53:09 +0000 (21:53 +0200)
committerAnselm R Garbe <anselm@garbe.us>
Sun, 23 Jun 2013 19:53:09 +0000 (21:53 +0200)
drw.c

diff --git a/drw.c b/drw.c
index bc4ac41da655288058589860241ac5d31d44ba1f..b13040565f6c01bec3f5927cbf7fcd30409f7c3d 100644 (file)
--- a/drw.c
+++ b/drw.c
@@ -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;
        tx = x + (h / 2);
        /* 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);
        if(!len)
                return;