Skip to content

Commit ec115b1

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 85baa92 commit ec115b1

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
@@ -1029,6 +1029,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
10291029
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
10301030
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
10311031
}
1032+
if (*details == 0x3C) {
1033+
*details = 0x24;
1034+
}
10321035
}
10331036
/* fallthrough */
10341037

@@ -1054,7 +1057,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10541057
// byte contains specific bit patterns, it indicates that only half cell
10551058
// should be displayed in the ASCII display mode. The bits are supposed
10561059
// to be filled in the Unicode display mode.
1057-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1060+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
10581061
if (details == 0x14 || details == 0x28) { // Special case
10591062
details = 0x18;
10601063
} else {
@@ -1094,6 +1097,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10941097
c = upperHalf;
10951098
} else if ((details & 0x39) == 0x28) {
10961099
c = lowerHalf;
1100+
} else if (details == 0x24) {
1101+
c = fullCell;
10971102
// End of special cases
10981103
} else if (popCount8(details) > 4) {
10991104
c = fullCell;

0 commit comments

Comments
 (0)