Fixing the not properly drawn rectangles.

master
Christoph Lohmann 14 years ago
parent 505741702f
commit 76a8bc5c3c
  1. 8
      svkbd.c

@ -177,6 +177,8 @@ drawkey(Key *k) {
XSetForeground(dpy, dc.gc, col[ColBG]); XSetForeground(dpy, dc.gc, col[ColBG]);
XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1); XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
XSetForeground(dpy, dc.gc, dc.norm[ColFG]); XSetForeground(dpy, dc.gc, dc.norm[ColFG]);
r.height -= 1;
r.width -= 1;
XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1); XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1);
XSetForeground(dpy, dc.gc, col[ColFG]); XSetForeground(dpy, dc.gc, col[ColFG]);
if(k->label) if(k->label)
@ -410,15 +412,15 @@ updatekeys() {
for(x = 0; i < LENGTH(keys) && keys[i].keysym != 0; i++) { for(x = 0; i < LENGTH(keys) && keys[i].keysym != 0; i++) {
keys[i].x = x; keys[i].x = x;
keys[i].y = y; keys[i].y = y;
keys[i].w = keys[i].width * (ww - 1) / base; keys[i].w = keys[i].width * ww / base;
if(rows != 1) if(rows != 1)
keys[i].h = h; keys[i].h = h;
else else
keys[i].h = (wh - 1) - y; keys[i].h = wh - y;
x += keys[i].w; x += keys[i].w;
} }
if(base != 0) if(base != 0)
keys[i - 1].w = (ww - 1) - keys[i - 1].x; keys[i - 1].w = ww - keys[i - 1].x;
y += h; y += h;
} }
} }

Loading…
Cancel
Save