Cell: non-OPAQUE always sets non-default bit

This commit is contained in:
nick black 2020-02-23 12:11:28 -05:00
parent bdd0917ea4
commit 40428fd05e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
3 changed files with 3 additions and 3 deletions

View File

@ -1035,7 +1035,7 @@ channel_set_alpha(unsigned* channel, int alpha){
return -1;
}
*channel = (alpha << CELL_ALPHA_SHIFT) | (*channel & ~CELL_ALPHA_MASK);
if(alpha != CELL_ALPHA_HIGHCONTRAST){
if(alpha != CELL_ALPHA_OPAQUE){
*channel |= CELL_BGDEFAULT_MASK;
}
return 0;

View File

@ -120,7 +120,7 @@ SUBCASE("SetItalic") {
CHECK(0 == cell_set_bg_alpha(&c, CELL_ALPHA_TRANSPARENT));
CHECK(CELL_ALPHA_TRANSPARENT == cell_bg_alpha(&c));
CHECK(cell_fg_default_p(&c));
CHECK(cell_bg_default_p(&c));
CHECK(!cell_bg_default_p(&c));
}
// common teardown

View File

@ -124,7 +124,7 @@ TEST_CASE("NotcursesBase") {
CHECK(0 > channels_set_bg_alpha(&channel, CELL_ALPHA_HIGHCONTRAST));
CHECK(CELL_ALPHA_TRANSPARENT == channels_bg_alpha(channel));
CHECK(channels_fg_default_p(channel));
CHECK(channels_bg_default_p(channel));
CHECK(!channels_bg_default_p(channel));
}
SUBCASE("Stats"){