Skip to content

Commit 2a785b5

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 f5789b4 commit 2a785b5

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 */
@@ -1187,7 +1190,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11871190
// byte contains specific bit patterns, it indicates that only half cell
11881191
// should be displayed in the ASCII display mode. The bits are supposed
11891192
// to be filled in the Unicode display mode.
1190-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1193+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11911194
if (details == 0x14 || details == 0x28) { // Special case
11921195
details = 0x18;
11931196
} else {
@@ -1227,6 +1230,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
12271230
c = upperHalf;
12281231
} else if ((details & 0x39) == 0x28) {
12291232
c = lowerHalf;
1233+
} else if (details == 0x24) {
1234+
c = fullCell;
12301235
// End of special cases
12311236
} else if (popCount8(details) > 4) {
12321237
c = fullCell;

0 commit comments

Comments
 (0)