Skip to content

Commit 200df88

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 <[email protected]>
1 parent 80366d4 commit 200df88

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
@@ -1123,6 +1123,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11231123
*details = 0xFF;
11241124
*details >>= blanksAtStart;
11251125
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
1126+
if (*details == 0x3C) {
1127+
*details = 0x24;
1128+
}
11261129
}
11271130
} else {
11281131
int deltaExpArg = MINIMUM(UINT16_WIDTH - 1, deltaExp);
@@ -1170,7 +1173,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11701173
// byte contains specific bit patterns, it indicates that only half cell
11711174
// should be displayed in the ASCII display mode. The bits are supposed
11721175
// to be filled in the Unicode display mode.
1173-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1176+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11741177
if (details == 0x14 || details == 0x28) { // Special case
11751178
details = 0x18;
11761179
} else {
@@ -1210,6 +1213,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
12101213
c = upperHalf;
12111214
} else if ((details & 0x39) == 0x28) {
12121215
c = lowerHalf;
1216+
} else if (details == 0x24) {
1217+
c = fullCell;
12131218
// End of special cases
12141219
} else if (popCount8(details) > 4) {
12151220
c = fullCell;

0 commit comments

Comments
 (0)