Skip to content

Commit 54d3d1c

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 d21a2d9 commit 54d3d1c

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
@@ -1015,6 +1015,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
10151015
blanksAtEnd = (blanksAtEnd % 8) / dotAlignment * dotAlignment;
10161016
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
10171017
}
1018+
if (*details == 0x3C) {
1019+
*details = 0x24;
1020+
}
10181021
}
10191022
/* fallthrough */
10201023

@@ -1039,7 +1042,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10391042
// byte contains specific bit patterns, it indicates that only half cell
10401043
// should be displayed in the ASCII display mode. The bits are supposed
10411044
// to be filled in the Unicode display mode.
1042-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1045+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
10431046
if (details == 0x14 || details == 0x28) { // Special case
10441047
details = 0x18;
10451048
} else {
@@ -1077,6 +1080,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
10771080
c = upperHalf;
10781081
} else if ((details & 0x39) == 0x28) {
10791082
c = lowerHalf;
1083+
} else if (details == 0x24) {
1084+
c = fullCell;
10801085
// End of special cases
10811086
} else if (popCount8(details) > 4) {
10821087
c = fullCell;

0 commit comments

Comments
 (0)