fix candidate popup bounds

This commit is contained in:
2026-08-11 19:34:27 +09:00
parent 7b40ef419f
commit 4bfb659b6d
2 changed files with 14 additions and 5 deletions

13
win.c
View File

@@ -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];