summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <anselm@garbe.us>2013-06-23 21:53:09 +0200
committerAnselm R Garbe <anselm@garbe.us>2013-06-23 21:53:09 +0200
commitb800a1d1366c2ba22b7c934f7527de0b1542fe78 (patch)
treeef2b58a09881d9c09e34802d9762f633c65ab980
parentapplied Julian's enum approach, (diff)
downloaddwm-b800a1d1366c2ba22b7c934f7527de0b1542fe78.tar.gz
dwm-b800a1d1366c2ba22b7c934f7527de0b1542fe78.zip
applied Jochen's drw_text patch, thanks
-rw-r--r--drw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drw.c b/drw.c
index bc4ac41..b130405 100644
--- 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
157 ty = y + (h / 2) - (th / 2) + drw->font->ascent; 157 ty = y + (h / 2) - (th / 2) + drw->font->ascent;
158 tx = x + (h / 2); 158 tx = x + (h / 2);
159 /* shorten text if necessary */ 159 /* shorten text if necessary */
160 for(len = MIN(olen, sizeof buf); len && tex.w > w - tex.h; len--) 160 for(len = MIN(olen, sizeof buf); len && (tex.w > w - tex.h || w < tex.h); len--)
161 drw_font_getexts(drw->font, text, len, &tex); 161 drw_font_getexts(drw->font, text, len, &tex);
162 if(!len) 162 if(!len)
163 return; 163 return;