kitty: partial sprixcells cannot be opaque #1553

pull/1567/head
nick black 3 years ago
parent 8a4bd09d9b
commit 74862a32b8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -307,6 +307,23 @@ write_kitty_data(FILE* fp, int linesize, int leny, int lenx,
if(fclose(fp) == EOF){
return -1;
}
// any sprixcells which don't cover the full cell underneath them cannot
// be SPRIXCELL_OPAQUE
if(lenx % cdimx){
for(y = 0 ; y < (leny + cdimy - 1) / cdimy ; ++y){
if(tacache[y * cols + cols - 1] == SPRIXCELL_OPAQUE){
tacache[y * cols + cols - 1] = SPRIXCELL_MIXED;
}
}
}
if(leny % cdimy){
y = (leny + cdimy - 1) / cdimy - 1;
for(x = 0 ; x < cols ; ++x){
if(tacache[y * cols + x] == SPRIXCELL_OPAQUE){
tacache[y * cols + x] = SPRIXCELL_MIXED;
}
}
}
return 0;
}
#undef RGBA_MAXLEN

Loading…
Cancel
Save