diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-05 22:06:21 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:24 +0200 |
| commit | 68c4bf5ffafc1dc6d113c3457a0c610cf38d2b7a (patch) | |
| tree | 0a5cda4ab4a6bc75eb9de66cde36dad28081b506 | |
| parent | a1ee56f631fb55161944a7c61b8153642098e09e (diff) | |
| download | muhqs-game-68c4bf5ffafc1dc6d113c3457a0c610cf38d2b7a.tar.gz muhqs-game-68c4bf5ffafc1dc6d113c3457a0c610cf38d2b7a.zip | |
do not use 0 as timer bar width
| -rw-r--r-- | go/ui/timerBar.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/go/ui/timerBar.go b/go/ui/timerBar.go index 2549f863..b7a99895 100644 --- a/go/ui/timerBar.go +++ b/go/ui/timerBar.go @@ -53,6 +53,9 @@ func (tb *TimerBar) render() *ebiten.Image { img.Fill(tb.bg) fraction := float64(time.Since(tb.start)) / float64(tb.deadline.Sub(tb.start)) barWidth := int(float64(tb.Width) * fraction) + if barWidth == 0 { + barWidth = 1 + } bar := ebiten.NewImage(barWidth, tb.Height) bar.Fill(tb.fg) op := ebiten.DrawImageOptions{} |
