浏览代码

applied Jochen's drw_text patch, thanks

Anselm R Garbe 12 年之前
父节点
当前提交
b800a1d136
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drw.c

+ 1 - 1
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;