gauge: render unlit blocks as hollow wireframe outlines (only aristas in grey)
This commit is contained in:
parent
ef3a24fd51
commit
259c4d6bbf
1 changed files with 34 additions and 8 deletions
|
|
@ -179,11 +179,24 @@ inline void drawBarBlock(uint8_t i, uint16_t color) {
|
|||
if (d < min_d) min_d = d;
|
||||
}
|
||||
if (min_d <= -0.5f) continue;
|
||||
if (min_d >= 0.5f) {
|
||||
tft.drawPixel(x, y, color);
|
||||
if (color == TFT_BLACK) {
|
||||
tft.drawPixel(x, y, TFT_BLACK);
|
||||
} else if (color == TFT_DARKGREY) { // Outline only (solo las aristas)
|
||||
if (min_d > 1.5f) {
|
||||
tft.drawPixel(x, y, TFT_BLACK);
|
||||
} else if (min_d >= 0.5f) {
|
||||
tft.drawPixel(x, y, TFT_DARKGREY);
|
||||
} else {
|
||||
uint8_t alpha = (uint8_t)((min_d + 0.5f) * 255.0f);
|
||||
tft.drawPixel(x, y, TFT_DARKGREY, alpha, TFT_BLACK);
|
||||
}
|
||||
} else {
|
||||
uint8_t alpha = (uint8_t)((min_d + 0.5f) * 255.0f);
|
||||
tft.drawPixel(x, y, color, alpha, TFT_BLACK);
|
||||
if (min_d >= 0.5f) {
|
||||
tft.drawPixel(x, y, color);
|
||||
} else {
|
||||
uint8_t alpha = (uint8_t)((min_d + 0.5f) * 255.0f);
|
||||
tft.drawPixel(x, y, color, alpha, TFT_BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -294,11 +307,24 @@ inline void drawQuadBarBlock(uint8_t cell, uint8_t i, uint16_t color) {
|
|||
}
|
||||
if (min_d <= -0.5f) continue;
|
||||
int16_t sx = ox + x;
|
||||
if (min_d >= 0.5f) {
|
||||
tft.drawPixel(sx, sy, color);
|
||||
if (color == TFT_BLACK) {
|
||||
tft.drawPixel(sx, sy, TFT_BLACK);
|
||||
} else if (color == TFT_DARKGREY) { // Outline only (solo las aristas)
|
||||
if (min_d > 1.3f) {
|
||||
tft.drawPixel(sx, sy, TFT_BLACK);
|
||||
} else if (min_d >= 0.5f) {
|
||||
tft.drawPixel(sx, sy, TFT_DARKGREY);
|
||||
} else {
|
||||
uint8_t alpha = (uint8_t)((min_d + 0.5f) * 255.0f);
|
||||
tft.drawPixel(sx, sy, TFT_DARKGREY, alpha, TFT_BLACK);
|
||||
}
|
||||
} else {
|
||||
uint8_t alpha = (uint8_t)((min_d + 0.5f) * 255.0f);
|
||||
tft.drawPixel(sx, sy, color, alpha, TFT_BLACK);
|
||||
if (min_d >= 0.5f) {
|
||||
tft.drawPixel(sx, sy, color);
|
||||
} else {
|
||||
uint8_t alpha = (uint8_t)((min_d + 0.5f) * 255.0f);
|
||||
tft.drawPixel(sx, sy, color, alpha, TFT_BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue