Skip to content

Commit 19a9056

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 8ff19fc commit 19a9056

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
@@ -1108,6 +1108,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11081108
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
11091109
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
11101110
}
1111+
if (*details == 0x3C) {
1112+
*details = 0x24;
1113+
}
11111114
}
11121115

11131116
/* fallthrough */
@@ -1188,7 +1191,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11881191
// byte contains specific bit patterns, it indicates that only half cell
11891192
// should be displayed in the ASCII display mode. The bits are supposed
11901193
// to be filled in the Unicode display mode.
1191-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1194+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11921195
if (details == 0x14 || details == 0x28) { // Special case
11931196
details = 0x18;
11941197
} else {
@@ -1228,6 +1231,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
12281231
c = upperHalf;
12291232
} else if ((details & 0x39) == 0x28) {
12301233
c = lowerHalf;
1234+
} else if (details == 0x24) {
1235+
c = fullCell;
12311236
// End of special cases
12321237
} else if (popCount8(details) > 4) {
12331238
c = fullCell;

0 commit comments

Comments
 (0)