From 04d9b62bbda02f664607565705e0fe4174cee6a4 Mon Sep 17 00:00:00 2001 From: Ruffalo-sunghwan Date: Sun, 29 May 2022 16:07:51 +0900 Subject: [PATCH] Kcalstats : fix bug from operator --- src/apps/tools/OswAppKcalStats.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/apps/tools/OswAppKcalStats.cpp b/src/apps/tools/OswAppKcalStats.cpp index 971d47214..8fada3bb3 100644 --- a/src/apps/tools/OswAppKcalStats.cpp +++ b/src/apps/tools/OswAppKcalStats.cpp @@ -39,8 +39,9 @@ void OswAppKcalStats::drawCurvedChart() { y1 = MIN_VALUE - weekValue[Index]; x2 = x1 + interval; y2 = MIN_VALUE - weekValue[Index + 1]; - + Serial.println("Cursor pointer before : " + String(this->cursorPos)); if (Index == this->cursorPos || ( this->cursorPos == 6 && Index == 5)) { + Serial.println("Cursor pointer : " + String(this->cursorPos)); hal->gfx()->drawThickTick(this->cursorPos == 6 && Index == 5 ? x2 : x1, 140, 0, 60, 0, 3, ui->getForegroundColor()); } @@ -51,7 +52,7 @@ void OswAppKcalStats::drawCurvedChart() { if (Index == 5) { hal->gfx()->fillCircle(x2, y2, 2.5,ui->getSuccessColor() ); } - } + } } void OswAppKcalStats::showCurvedChart() { @@ -77,7 +78,9 @@ void OswAppKcalStats::showCurvedChart() { // Show the day of the week that cursor (Dynamic weekDay--info) uint32_t d, wD = 0; hal->getLocalDate(&d, &wD); - uint32_t wDay = wD - (6 - this->cursorPos) >= 0 ? wD - (6 - this->cursorPos) : (wD - (6 - this->cursorPos)) + 7; + int cursorWeekDay = wD - (6 - this->cursorPos); + int findWeekDay = (cursorWeekDay >= 0) ? cursorWeekDay : (cursorWeekDay + 7); + uint32_t wDay = findWeekDay; hal->gfx()->setTextSize(1); hal->gfx()->setTextCenterAligned();