Skip to content

Commit 8daee73

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 32ec759 commit 8daee73

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
@@ -1117,6 +1117,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11171117
*details = 0xFF;
11181118
*details >>= blanksAtStart;
11191119
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
1120+
if (*details == 0x3C) {
1121+
*details = 0x24;
1122+
}
11201123
}
11211124
} else {
11221125
int deltaExpArg = MINIMUM(UINT16_WIDTH - 1, deltaExp);
@@ -1164,7 +1167,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11641167
// byte contains specific bit patterns, it indicates that only half cell
11651168
// should be displayed in the ASCII display mode. The bits are supposed
11661169
// to be filled in the Unicode display mode.
1167-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1170+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11681171
if (details == 0x14 || details == 0x28) { // Special case
11691172
details = 0x18;
11701173
} else {
@@ -1204,6 +1207,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
12041207
c = upperHalf;
12051208
} else if ((details & 0x39) == 0x28) {
12061209
c = lowerHalf;
1210+
} else if (details == 0x24) {
1211+
c = fullCell;
12071212
// End of special cases
12081213
} else if (popCount8(details) > 4) {
12091214
c = fullCell;

0 commit comments

Comments
 (0)