summaryrefslogtreecommitdiff
path: root/src/scenes/place_detail.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scenes/place_detail.c')
-rw-r--r--src/scenes/place_detail.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/scenes/place_detail.c b/src/scenes/place_detail.c
index 49973a4..f214347 100644
--- a/src/scenes/place_detail.c
+++ b/src/scenes/place_detail.c
@@ -984,18 +984,22 @@ static void draw_duration_of_scheduled_job_entry(scheduled_job job, scheduled_jo
if (scheduled_time.day == SUNDAY) highlight_y = TILE_Y(MONDAY);
if (overflow_to_next_day > 0) {
- int extra_days = overflow_to_next_day / TIME_SLOTS_PER_DAY;
+ int extra_days = ceil(overflow_to_next_day / (float)TIME_SLOTS_PER_DAY);
int curr_day = scheduled_time.day;
+ //printf("%d %d %d\n", extra_days, duration_of_job_measured_in_timeslots_max, overflow_to_next_day);
for (int xx = 0; xx < extra_days; xx++) {
s32 overflow = overflow_to_next_day % TIME_SLOTS_PER_DAY;
if (xx != extra_days-1) overflow = TIME_SLOTS_PER_DAY;
+ else if (overflow == 0) {
+ overflow = TIME_SLOTS_PER_DAY;
+ }
if (curr_day == SUNDAY) {
curr_day = MONDAY;
highlight_y = TILE_Y(MONDAY);
}
- printf("%d %d %d\n", overflow_to_next_day, extra_days, overflow);
+ //printf("%d %d %d\n", overflow_to_next_day, extra_days, overflow);
renderer->render_rectangle(TILE_X(0), highlight_y, timeslot_w*overflow, timeslot_h, tile_color_bg);
overflow_to_next_day -= TIME_SLOTS_PER_DAY;
highlight_y += timeslot_h;