From b84494043fdd32dc32009f792354f2b7b00f72ea Mon Sep 17 00:00:00 2001 From: speedie Date: Wed, 8 Mar 2023 22:51:00 +0100 Subject: [PATCH] fix one small thing with last commit --- TODO | 1 - libs/draw.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/TODO b/TODO index cc49802..98bc29b 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ # TODO for spmenu - Mouse bind array (mouse.h) -- Remove SGR sequences from width when item text is drawn, currently the width of the item before SGR sequences are used, resulting in some ugly behavior for the selected item (drawitem function libs/draw.c) - Add configuration file using (probably) libconfig diff --git a/libs/draw.c b/libs/draw.c index 4e907fe..5aeb081 100644 --- a/libs/draw.c +++ b/libs/draw.c @@ -66,7 +66,7 @@ drawitem(struct item *item, int x, int y, int w) buffer[wr] = '\0'; /* clear out character */ apply_fribidi(buffer); - rw = TEXTW(buffer) - lrpad; + rw = MIN(w, TEXTW(buffer) - lrpad); drw_text(drw, x, y, rw + lp, bh, lp, isrtl ? fribidi_text : buffer, 0, pango_item ? True : False); x += rw + lp;