diff options
| author | bakkeby <[email protected]> | 2022-01-20 22:21:55 +0100 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2022-02-11 11:43:36 +0100 |
| commit | 8e36c36bcf4c5ba53949923d75ad46f984c12cbc (patch) | |
| tree | 257b2c08a37c09071522155de55ced6ebe97daaf | |
| parent | d1662b6636202ae5c6aea81074b539fa7f347322 (diff) | |
| download | dwm-flexipatch-8e36c36bcf4c5ba53949923d75ad46f984c12cbc.tar.gz dwm-flexipatch-8e36c36bcf4c5ba53949923d75ad46f984c12cbc.zip | |
Fix for drw_text cropping one characters too many when the text is too long and replacing with ... ref. #216
| -rw-r--r-- | drw.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -507,8 +507,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp if (utf8strlen) { drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); /* shorten text if necessary */ - for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) - drw_font_getexts(usedfont, utf8str, len, &ew, NULL); + for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; drw_font_getexts(usedfont, utf8str, len, &ew, NULL)) + len--; if (len) { memcpy(buf, utf8str, len); |
