mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +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
|
// Touches
|
||||||
ids := map[int]struct{}{}
|
ids := map[int]struct{}{}
|
||||||
|
|
||||||
// Reset the previous states first since some gamepad IDs might be already gone.
|
i.prevTouchDurations = map[int]int{}
|
||||||
for id := range i.prevTouchDurations {
|
for id := range i.touchDurations {
|
||||||
i.prevTouchDurations[id] = 0
|
i.prevTouchDurations[id] = i.touchDurations[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, id := range ebiten.TouchIDs() {
|
for _, id := range ebiten.TouchIDs() {
|
||||||
ids[id] = struct{}{}
|
ids[id] = struct{}{}
|
||||||
i.prevTouchDurations[id] = i.touchDurations[id]
|
|
||||||
i.touchDurations[id]++
|
i.touchDurations[id]++
|
||||||
}
|
}
|
||||||
idsToDelete = []int{}
|
idsToDelete = []int{}
|
||||||
|
Loading…
Reference in New Issue
Block a user