Skip to content

Commit d1623cd

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 0c5946f commit d1623cd

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
@@ -1111,6 +1111,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11111111
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
11121112
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
11131113
}
1114+
if (*details == 0x3C) {
1115+
*details = 0x24;
1116+
}
11141117
}
11151118

11161119
/* fallthrough */
@@ -1190,7 +1193,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11901193
// byte contains specific bit patterns, it indicates that only half cell
11911194
// should be displayed in the ASCII display mode. The bits are supposed
11921195
// to be filled in the Unicode display mode.
1193-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1196+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11941197
if (details == 0x14 || details == 0x28) { // Special case
11951198
details = 0x18;
11961199
} else {
@@ -1230,6 +1233,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
12301233
c = upperHalf;
12311234
} else if ((details & 0x39) == 0x28) {
12321235
c = lowerHalf;
1236+
} else if (details == 0x24) {
1237+
c = fullCell;
12331238
// End of special cases
12341239
} else if (popCount8(details) > 4) {
12351240
c = fullCell;

0 commit comments

Comments
 (0)