[hackers] [dmenu] Fix cursor drawn position with wide glyphs || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sun, 22 Apr 2018 14:34:24 +0200 (CEST)

commit 0f76dd2fb89748eb5460adbc87c4e98bcce09763
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Sun Apr 22 14:18:34 2018 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Sun Apr 22 14:19:20 2018 +0200

    Fix cursor drawn position with wide glyphs

diff --git a/dmenu.c b/dmenu.c
index 314256f..d764658 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -144,7 +144,7 @@ drawmenu(void)
         drw_setscheme(drw, scheme[SchemeNorm]);
         drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);
 
- drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
+ curpos = TEXTW(text) - TEXTW(&text[cursor]);
         if ((curpos += lrpad / 2 - 1) < w) {
                 drw_setscheme(drw, scheme[SchemeNorm]);
                 drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0);
Received on Sun Apr 22 2018 - 14:34:24 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 22 2018 - 14:36:58 CEST