mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
inpututil: Bug fix: prevTouchDurations was not updated correctly
This commit is contained in:
parent
f5336ce7bc
commit
5677c8a916
@ -145,14 +145,13 @@ func (i *inputState) update() {
|
||||
// Touches
|
||||
ids := map[int]struct{}{}
|
||||
|
||||
// Reset the previous states first since some gamepad IDs might be already gone.
|
||||
for id := range i.prevTouchDurations {
|
||||
i.prevTouchDurations[id] = 0
|
||||
i.prevTouchDurations = map[int]int{}
|
||||
for id := range i.touchDurations {
|
||||
i.prevTouchDurations[id] = i.touchDurations[id]
|
||||
}
|
||||
|
||||
for _, id := range ebiten.TouchIDs() {
|
||||
ids[id] = struct{}{}
|
||||
i.prevTouchDurations[id] = i.touchDurations[id]
|
||||
i.touchDurations[id]++
|
||||
}
|
||||
idsToDelete = []int{}
|
||||
|
Loading…
Reference in New Issue
Block a user