Skip to content

Commit 0d092e5

Browse files
committed
Add a special "details" value for "Graph2" meter drawing
This special case of "details" value would print as ':' in the ASCII display mode. It is used in "Graph2" meter drawing only. Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
1 parent b1a6c0e commit 0d092e5

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
@@ -1110,6 +1110,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11101110
*details = 0xFF;
11111111
*details >>= blanksAtStart;
11121112
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
1113+
if (*details == 0x3C) {
1114+
*details = 0x24;
1115+
}
11131116
}
11141117
} else {
11151118
int deltaExpArg = MINIMUM(UINT16_WIDTH - 1, deltaExp);
@@ -1157,7 +1160,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11571160
// byte contains specific bit patterns, it indicates that only half cell
11581161
// should be displayed in the ASCII display mode. The bits are supposed
11591162
// to be filled in the Unicode display mode.
1160-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1163+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11611164
if (details == 0x14 || details == 0x28) { // Special case
11621165
details = 0x18;
11631166
} else {
@@ -1197,6 +1200,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11971200
c = upperHalf;
11981201
} else if ((details & 0x39) == 0x28) {
11991202
c = lowerHalf;
1203+
} else if (details == 0x24) {
1204+
c = fullCell;
12001205
// End of special cases
12011206
} else if (popCount8(details) > 4) {
12021207
c = fullCell;

0 commit comments

Comments
 (0)