Skip to content

Commit 728ef87

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 8b30ef4 commit 728ef87

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Meter.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
10191019
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
10201020
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
10211021
}
1022+
if (*details == 0x3C) {
1023+
*details = 0x24;
1024+
}
10221025
}
10231026
/* fallthrough */
10241027

@@ -1043,7 +1046,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10431046
// byte contains specific bit patterns, it indicates that only half cell
10441047
// should be displayed in the ASCII display mode. The bits are supposed
10451048
// to be filled in the Unicode display mode.
1046-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1049+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
10471050
if (details == 0x14 || details == 0x28) { // Special case
10481051
details = 0x18;
10491052
} else {
@@ -1081,6 +1084,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10811084
c = upperHalf;
10821085
} else if ((details & 0x39) == 0x28) {
10831086
c = lowerHalf;
1087+
} else if (details == 0x24) {
1088+
c = fullCell;
10841089
// End of special cases
10851090
} else if (popCount8(details) > 4) {
10861091
c = fullCell;

0 commit comments

Comments
 (0)