aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'render.c')
-rw-r--r--render.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/render.c b/render.c
index 3813af5..070fad9 100644
--- a/render.c
+++ b/render.c
@@ -28,7 +28,8 @@ void calc_widths(struct menu *menu) {
menu->right_arrow = text_width(cairo, menu->font, ">") + 2 * menu->padding;
// Calculate item widths and input area width
- for (struct item *item = menu->items; item; item = item->next) {
+ for (size_t i = 0; i < menu->item_count; i++) {
+ struct item *item = &menu->items[i];
item->width = text_width(cairo, menu->font, item->text);
if (item->width > menu->inputw) {
menu->inputw = item->width;