use pixel_draw to verify bitmap support

pull/1813/head
nick black 3 years ago
parent 8022faf2c0
commit f388e3d7da
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -63,7 +63,7 @@ tinfo_debug_caps(const tinfo* ti, FILE* debugfp, int rows, int cols,
capyn(get_escape(ti, ESCAPE_BGOP)));
fprintf(debugfp, "%srows: %u cols: %u rpx: %u cpx: %u (%dx%d)\n",
indent, rows, cols, ti->cellpixy, ti->cellpixx, rows * ti->cellpixy, cols * ti->cellpixx);
if(!ti->pixel_init){
if(!ti->pixel_draw){
fprintf(debugfp, "%sdidn't detect bitmap graphics support\n", indent);
}else if(ti->sixel_maxy){
fprintf(debugfp, "%smax sixel size: %dx%d colorregs: %u\n",

@ -255,7 +255,7 @@ int update_term_dimensions(int fd, int* rows, int* cols, tinfo* tcache,
tcache->cellpixy = ws.ws_row ? ws.ws_ypixel / ws.ws_row : 0;
tcache->cellpixx = ws.ws_col ? ws.ws_xpixel / ws.ws_col : 0;
if(tcache->cellpixy == 0 || tcache->cellpixx == 0){
tcache->pixel_init = NULL; // disable support
tcache->pixel_draw = NULL; // disable support
}
}
if(tcache->sixel_maxy_pristine){
@ -987,7 +987,7 @@ recursive_lock_init(pthread_mutex_t *lock){
}
int notcurses_check_pixel_support(const notcurses* nc){
if(nc->tcache.pixel_init){
if(nc->tcache.pixel_draw){
return 1;
}
return 0;

Loading…
Cancel
Save