Skip to content

Commit f57affb

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 1d38fe8 commit f57affb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: Meter.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
10261026
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
10271027
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
10281028
}
1029+
if (*details == 0x3C) {
1030+
*details = 0x24;
1031+
}
10291032
}
10301033
/* fallthrough */
10311034

@@ -1050,7 +1053,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10501053
// byte contains specific bit patterns, it indicates that only half cell
10511054
// should be displayed in the ASCII display mode. The bits are supposed
10521055
// to be filled in the Unicode display mode.
1053-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1056+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
10541057
if (details == 0x14 || details == 0x28) { // Special case
10551058
details = 0x18;
10561059
} else {
@@ -1088,6 +1091,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10881091
c = upperHalf;
10891092
} else if ((details & 0x39) == 0x28) {
10901093
c = lowerHalf;
1094+
} else if (details == 0x24) {
1095+
c = fullCell;
10911096
// End of special cases
10921097
} else if (popCount8(details) > 4) {
10931098
c = fullCell;

0 commit comments

Comments
 (0)