calculate pixel-cell geometry from responses

This commit is contained in:
nick black 2021-09-01 02:24:34 -04:00
parent fcd845c99a
commit ccd2068ee3

View File

@ -1729,14 +1729,18 @@ int ncinputlayer_init(tinfo* tcache, FILE* infp, queried_terminals_e* detected,
if(cursor_y){
*cursor_y = inits.cursor_y - 1;
}
if(inits.pixelwidth && inits.pixelheight){
tcache->pixy = inits.pixelheight;
tcache->pixx = inits.pixelwidth;
}
if(inits.dimy && inits.dimx){
tcache->default_rows = inits.dimy;
tcache->default_cols = inits.dimx;
}
if(inits.pixelwidth && inits.pixelheight){
tcache->pixy = inits.pixelheight;
tcache->pixx = inits.pixelwidth;
if(tcache->default_rows && tcache->default_cols){
tcache->cellpixx = tcache->pixx / tcache->default_cols;
tcache->cellpixy = tcache->pixy / tcache->default_rows;
}
}
if(inits.kittygraphics){ // kitty trumps sixel
loginfo("advertised kitty; disabling sixel\n");
tcache->color_registers = 0;