From 91c152c123924d7b8bfa14722d18c652d7e42966 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 27 Aug 2021 11:17:47 -0700 Subject: [PATCH] Santa was broken and nobody said anything! --- santa/src/game.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/santa/src/game.rs b/santa/src/game.rs index 4f3a4ee323..16ff95433a 100644 --- a/santa/src/game.rs +++ b/santa/src/game.rs @@ -119,7 +119,7 @@ impl Game { } fn update_time_panel(&mut self, ctx: &mut EventCtx, app: &App) { - let pct = (app.time - Time::START_OF_DAY) / self.state.level.time_limit; + let pct = ((app.time - Time::START_OF_DAY) / self.state.level.time_limit).min(1.0); let text_color = if pct < 0.75 { Color::WHITE } else { Color::RED }; let label = Line(format!(