Skip to content

Commit a715ff3

Browse files
committed
fixed layout of lap data
1 parent 41da56e commit a715ff3

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/displayapp/screens/StopWatch.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,14 @@ void StopWatch::RenderLaps() {
180180

181181
if (lap) {
182182
TimeSeparated laptime = ConvertTicksToTimeSegments(lap->timeSinceStart);
183-
char buffer[16];
184-
snprintf(buffer, sizeof(buffer), "#%3d %2d:%02d.%02d\n",
185-
lap->number, laptime.mins, laptime.secs, laptime.hundredths);
183+
char buffer[19];
184+
if (laptime.hours == 0) {
185+
snprintf(buffer, sizeof(buffer), "#%-3d %2d:%02d.%02d\n",
186+
lap->number, laptime.mins, laptime.secs, laptime.hundredths);
187+
} else {
188+
snprintf(buffer, sizeof(buffer), "#%-3d %3d:%02d:%02d.%02d\n",
189+
lap->number, laptime.hours, laptime.mins, laptime.secs, laptime.hundredths);
190+
}
186191
lv_label_ins_text(lapText, LV_LABEL_POS_LAST, buffer);
187192
} else {
188193
lv_label_ins_text(lapText, LV_LABEL_POS_LAST, "\n");

0 commit comments

Comments
 (0)