popup: refine the input panel
This commit is contained in:
@@ -179,7 +179,7 @@ font_render(struct ct *t)
|
||||
static char *plain[] = { "A", "가", "あ", "漢", "☆", "𠀋" };
|
||||
u32int *buf, *mem;
|
||||
Str a, heart, longrow, missing;
|
||||
int i, natural, w, x, y;
|
||||
int i, maxx, maxy, minx, miny, natural, w, x, y;
|
||||
|
||||
mem = emalloc((Testn + 2 * Guard) * sizeof mem[0]);
|
||||
fillpixels(mem, Testn + 2 * Guard, guardcolor);
|
||||
@@ -231,6 +231,21 @@ font_render(struct ct *t)
|
||||
}
|
||||
CT_EQ_INT(t, natural, textwidth(&longrow));
|
||||
|
||||
fillpixels(buf, Testn, Colsel);
|
||||
textdrawfitcolor(buf, Testw, Testh, 2*Fontsz, Fontsz,
|
||||
2*Fontsz, Colselfg, &longrow);
|
||||
CT_CHECK(t, (Colselfg & Rgbmask) != (Colsel & Rgbmask));
|
||||
if(CT_CHECK(t, inkbounds(buf, Colsel,
|
||||
&minx, &miny, &maxx, &maxy))){
|
||||
CT_CHECK(t, minx >= 2*Fontsz);
|
||||
CT_CHECK(t, maxx < 4*Fontsz);
|
||||
CT_CHECK(t, miny >= Fontsz);
|
||||
CT_CHECK(t, maxy < 2*Fontsz);
|
||||
}
|
||||
checkoutside(t, buf, Colsel, Fontsz);
|
||||
checkguards(t, mem);
|
||||
CT_EQ_INT(t, natural, textwidth(&longrow));
|
||||
|
||||
missing = mkstr("\xF4\x8F\xBF\xBF");
|
||||
for(i = 0; i < 32; i++){
|
||||
textdraw(buf, Testw, Testh, Fontsz, Fontsz, &heart);
|
||||
|
||||
Reference in New Issue
Block a user