fix candidate popup bounds
This commit is contained in:
13
win.c
13
win.c
@@ -78,17 +78,26 @@ drawstr(u32int *buf, int x, int y, Rune *r, int n, int maxw, int maxh)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fill(u32int *buf, int n, u32int color)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < n; i++)
|
||||
buf[i] = color;
|
||||
}
|
||||
|
||||
static void
|
||||
drawkouho(Drawcmd *dc, int first, int n, int w, int h)
|
||||
{
|
||||
int sely, y, i;
|
||||
Str *s;
|
||||
|
||||
memset(img, (uchar)Colbg, w * h * sizeof(u32int));
|
||||
fill(img, w * h, Colbg);
|
||||
drawstr(img, 0, 0, dc->pre.r, dc->pre.n, w, h);
|
||||
if(dc->sel >= 0){
|
||||
sely = Fontsz + dc->sel * Fontsz;
|
||||
memset(img + sely * w, (uchar)Colsel, Fontsz * w * sizeof(u32int));
|
||||
fill(img + sely * w, Fontsz * w, Colsel);
|
||||
}
|
||||
for(i = 0, y = Fontsz; i < n; i++, y += Fontsz){
|
||||
s = &dc->kouho[first+i];
|
||||
|
||||
Reference in New Issue
Block a user