From 4d03b9fd987e7484c8b09387bc45dc4a8fcf827c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 18 Aug 2022 15:42:43 +0900 Subject: [PATCH] examples/audio: use ebitenutil.DrawCircle Updates #2250 --- examples/audio/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/audio/main.go b/examples/audio/main.go index 402cbd93f..7c6973af5 100644 --- a/examples/audio/main.go +++ b/examples/audio/main.go @@ -338,10 +338,9 @@ func (p *Player) draw(screen *ebiten.Image) { // Draw the cursor on the bar. c := p.current - cw, ch := 8, 20 - cx := int(time.Duration(w)*c/p.total) + x - cw/2 - cy := y - (ch-h)/2 - ebitenutil.DrawRect(screen, float64(cx), float64(cy), float64(cw), float64(ch), playerCurrentColor) + cx := float64(x) + float64(w)*float64(p.current)/float64(p.total) + cy := float64(y) + float64(h)/2 + ebitenutil.DrawCircle(screen, cx, cy, 12, playerCurrentColor) // Compose the curren time text. m := (c / time.Minute) % 100