ref: c5bfb20546c1694803b0a5d9b7477e5c27af0dba
parent: 8a6a354e22521e7d2d14b8b4c2d1b7a65a0c8d5e
author: qwx <qwx@sciops.net>
date: Sun Oct 23 16:00:24 EDT 2022
bar: fix item boundaries misspacing
--- a/sys/src/cmd/bar.c
+++ b/sys/src/cmd/bar.c
@@ -147,6 +147,7 @@
draw(screen, r, cback, nil, ZP);
string(screen, p, ctext, ZP, f, s);
if(hlitem >= 0){
+ r.min.x += sepw;
for(i = 0; i < hlitem; i++)
r.min.x += itemw[i];
r.max.x = r.min.x + itemw[i];
@@ -226,7 +227,7 @@
return;
}
- for(i = ix = 0; i < nitems; i++){
+ for(i = 0, ix = sepw; i < nitems; i++){
ix += itemw[i];
if(x <= ix){
fprint(1, "%d\t%s\n", buttons, items[i]);