examples/audio: Add padding

This commit is contained in:
Hajime Hoshi 2016-04-19 02:45:51 +09:00
parent 895c559b8e
commit 242d36a9a4

View File

@ -165,7 +165,8 @@ func (p *Player) updateBar() error {
}
x, y := ebiten.CursorPosition()
bx, by, bw, bh := playerBarRect()
if y < by || by+bh <= y {
const padding = 4
if y < by-padding || by+bh+padding <= y {
return nil
}
if x < bx || bx+bw <= x {