changeset: 355:886757898b8b
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Tue Aug 10 14:14:37 2010 +0100
files: dmenu.c
description:
reverted calcoffsets
diff -r 888fdf5396eb -r 886757898b8b dmenu.c
--- a/dmenu.c Tue Aug 10 13:38:49 2010 +0100
+++ b/dmenu.c Tue Aug 10 14:14:37 2010 +0100
@@ -82,11 +82,12 @@
else
n = mw - (promptw + inputw + textw(dc, "<") + textw(dc, ">"));
- for(i = 0, next = curr; i <= n && next; next = next->right)
- i += (lines > 0) ? LINEH : MIN(textw(dc, next->text), mw/3);
-
- for(i = 0, prev = curr; i <= n && prev && prev->left; prev = prev->left)
- i += (lines > 0) ? LINEH : MIN(textw(dc, prev->left->text), mw/3);
+ for(i = 0, next = curr; next; next = next->right)
+ if((i += (lines > 0) ? LINEH : MIN(textw(dc, next->text), mw/3)) > n)
+ break;
+ for(i = 0, prev = curr; prev && prev->left; prev = prev->left)
+ if((i += (lines > 0) ? LINEH : MIN(textw(dc, prev->left->text), mw/3)) > n)
+ break;
}
char *
Received on Tue Aug 10 2010 - 15:14:40 CEST
This archive was generated by hypermail 2.2.0 : Tue Aug 10 2010 - 15:24:03 CEST