ui: Remove UpdateTouches

This commit is contained in:
Hajime Hoshi 2019-03-31 01:27:13 +09:00
parent 43ec1e7fb3
commit 5d6f66935a
3 changed files with 8 additions and 9 deletions

View File

@ -122,8 +122,12 @@ func AdjustedTouches() []*input.Touch {
ts := input.Get().Touches()
adjusted := make([]*input.Touch, len(ts))
for i, t := range ts {
x, y := adjustPosition(t.Position())
adjusted[i] = input.NewTouch(t.ID(), x, y)
x, y := adjustPosition(t.X, t.Y)
adjusted[i] = &input.Touch{
ID: t.ID,
X: x,
Y: y,
}
}
return adjusted
}

View File

@ -140,7 +140,7 @@ func appMain(a app.App) {
for _, t := range touches {
ts = append(ts, t)
}
UpdateTouches(ts)
input.Get().UpdateTouches(ts)
}
}
}
@ -434,10 +434,6 @@ func SetVsyncEnabled(enabled bool) {
// Do nothing
}
func UpdateTouches(touches []*input.Touch) {
input.Get().UpdateTouches(touches)
}
func DeviceScaleFactor() float64 {
return getDeviceScale()
}

View File

@ -18,7 +18,6 @@ package mobile
import (
"github.com/hajimehoshi/ebiten/internal/input"
"github.com/hajimehoshi/ebiten/internal/ui"
)
type position struct {
@ -39,5 +38,5 @@ func updateTouches() {
Y: position.y,
})
}
ui.UpdateTouches(ts)
input.Get().UpdateTouches(ts)
}