uidriver/js: Bug fix: Touches were not updated correctly

Fixes #846
This commit is contained in:
Hajime Hoshi 2019-04-15 02:56:46 +09:00
parent 5487dd9ea8
commit 865523048d

View File

@ -325,7 +325,7 @@ func (i *Input) setMouseCursorFromEvent(e js.Value) {
func (i *Input) updateTouches(e js.Value) {
j := e.Get("targetTouches")
ts := map[int]pos{}
for i := 0; i < len(ts); i++ {
for i := 0; i < j.Length(); i++ {
jj := j.Call("item", i)
id := jj.Get("identifier").Int()
ts[id] = pos{