Skip to content

Commit 745f394

Browse files
committed
(draft) Add a special case for cell "details"
This special case of "details" value would print as ':' in the ASCII display mode. It is used in "positive/negative" graph display only. Signed-off-by: Kang-Che Sung <[email protected]>
1 parent 7db2107 commit 745f394

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Meter.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
10721072
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
10731073
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
10741074
}
1075+
if (*details == 0x3C) {
1076+
*details = 0x24;
1077+
}
10751078
}
10761079
/* fallthrough */
10771080

@@ -1096,7 +1099,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10961099
// byte contains specific bit patterns, it indicates that only half cell
10971100
// should be displayed in the ASCII display mode. The bits are supposed
10981101
// to be filled in the Unicode display mode.
1099-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1102+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11001103
if (details == 0x14 || details == 0x28) { // Special case
11011104
details = 0x18;
11021105
} else {
@@ -1134,6 +1137,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11341137
c = upperHalf;
11351138
} else if ((details & 0x39) == 0x28) {
11361139
c = lowerHalf;
1140+
} else if (details == 0x24) {
1141+
c = fullCell;
11371142
// End of special cases
11381143
} else if (popCount8(details) > 4) {
11391144
c = fullCell;

0 commit comments

Comments
 (0)