internal/cbackend: bug fix: compile error again

This commit is contained in:
Hajime Hoshi 2022-02-06 19:07:17 +09:00
parent 0eecab8278
commit 887a3ff749
2 changed files with 4 additions and 6 deletions

View File

@ -66,8 +66,6 @@ import (
"reflect"
"time"
"unsafe"
"github.com/hajimehoshi/ebiten/v2/internal/ui"
)
type Gamepad struct {
@ -81,7 +79,7 @@ type Gamepad struct {
}
type Touch struct {
ID ui.TouchID
ID int
X int
Y int
}
@ -153,7 +151,7 @@ func AppendTouches(touches []Touch) []Touch {
for _, t := range cTouches {
touches = append(touches, Touch{
ID: ui.TouchID(t.id),
ID: int(t.id),
X: int(t.x),
Y: int(t.y),
})

View File

@ -57,7 +57,7 @@ func (i *Input) AppendTouchIDs(touchIDs []TouchID) []TouchID {
defer i.m.Unlock()
for _, t := range i.touches {
touchIDs = append(touchIDs, t.ID)
touchIDs = append(touchIDs, TouchID(t.ID))
}
return touchIDs
}
@ -79,7 +79,7 @@ func (i *Input) TouchPosition(id TouchID) (x, y int) {
defer i.m.Unlock()
for _, t := range i.touches {
if t.ID == id {
if TouchID(t.ID) == id {
return t.X, t.Y
}
}