This commit is contained in:
vadim committed 2026-10-27 17:23:09 +03:00
1 parent 9662d1278f
commit 16d85d5c4f
1 file changed
+8 -1
+8 -1
View File
@@ -367,10 +367,17 @@ void drawHeader(const char *symbol, const char *interval, float price, float cha
char buf[32];
snprintf(buf, sizeof(buf), "%.*f", priceDecimals(price), price);
uint16_t color = changePct >= 0 ? TFT_GREEN : TFT_RED;
tft.setTextColor(color, TFT_BLACK);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
tft.setTextDatum(TR_DATUM);
tft.setFreeFont(&FreeSansBold9pt7b);
tft.drawString(buf, tft.width() - 4, 1);
// Стрелка перед ценой: зелёная вверх / красная вниз
int ax = tft.width() - 4 - tft.textWidth(buf) - 5; // правый край стрелки
if (changePct >= 0)
tft.fillTriangle(ax - 9, 12, ax, 12, ax - 4, 3, color);
else
tft.fillTriangle(ax - 9, 3, ax, 3, ax - 4, 12, color);
tft.setTextColor(color, TFT_BLACK);
// setTextFont сбрасывает free font, иначе drawString(..., 1) рисовал бы им
tft.setTextFont(1);
snprintf(buf, sizeof(buf), "%+.2f%% 24h", changePct);