Skip to content

Commit 62ad9d3

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 936e74d commit 62ad9d3

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
@@ -1108,6 +1108,9 @@ static int GraphMeterMode_lookupCell(const Meter* this, const GraphDrawContext*
11081108
*details = 0xFF;
11091109
*details >>= blanksAtStart;
11101110
*details = (uint8_t)((*details >> blanksAtEnd) << blanksAtEnd);
1111+
if (*details == 0x3C) {
1112+
*details = 0x24;
1113+
}
11111114
}
11121115
} else {
11131116
int deltaExpArg = MINIMUM(UINT16_WIDTH - 1, deltaExp);
@@ -1155,7 +1158,7 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11551158
// byte contains specific bit patterns, it indicates that only half cell
11561159
// should be displayed in the ASCII display mode. The bits are supposed
11571160
// to be filled in the Unicode display mode.
1158-
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28) {
1161+
if ((details & 0x9C) == 0x14 || (details & 0x39) == 0x28 || details == 0x24) {
11591162
if (details == 0x14 || details == 0x28) { // Special case
11601163
details = 0x18;
11611164
} else {
@@ -1195,6 +1198,8 @@ static void GraphMeterMode_printCellDetails(uint8_t details) {
11951198
c = upperHalf;
11961199
} else if ((details & 0x39) == 0x28) {
11971200
c = lowerHalf;
1201+
} else if (details == 0x24) {
1202+
c = fullCell;
11981203
// End of special cases
11991204
} else if (popCount8(details) > 4) {
12001205
c = fullCell;

0 commit comments

Comments
 (0)