Skip to content

Commit b9b525e

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 64e91a4 commit b9b525e

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
@@ -1106,6 +1106,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11061106
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
11071107
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
11081108
}
1109+
if (*details == 0x3C) {
1110+
*details = 0x24;
1111+
}
11091112
}
11101113

11111114
/* fallthrough */
@@ -1185,7 +1188,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11851188
// byte contains specific bit patterns, it indicates that only half cell
11861189
// should be displayed in the ASCII display mode. The bits are supposed
11871190
// to be filled in the Unicode display mode.
1188-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1191+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11891192
if (details == 0x14 || details == 0x28) { // Special case
11901193
details = 0x18;
11911194
} else {
@@ -1225,6 +1228,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
12251228
c = upperHalf;
12261229
} else if ((details & 0x39) == 0x28) {
12271230
c = lowerHalf;
1231+
} else if (details == 0x24) {
1232+
c = fullCell;
12281233
// End of special cases
12291234
} else if (popCount8(details) > 4) {
12301235
c = fullCell;

0 commit comments

Comments
 (0)