Skip to content

Commit

Permalink
Kcalstats : fix bug from operator
Browse files Browse the repository at this point in the history
  • Loading branch information
RuffaloLavoisier committed May 29, 2022
1 parent c5efe56 commit 04d9b62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/apps/tools/OswAppKcalStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -51,7 +52,7 @@ void OswAppKcalStats::drawCurvedChart() {
if (Index == 5) {
hal->gfx()->fillCircle(x2, y2, 2.5,ui->getSuccessColor() );
}
}
}
}

void OswAppKcalStats::showCurvedChart() {
Expand All @@ -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();
Expand Down

0 comments on commit 04d9b62

Please sign in to comment.