mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
input: Bug fix: Touches requries lock
This commit is contained in:
parent
683c692a5b
commit
05104744d3
@ -105,6 +105,8 @@ func (i *input) IsGamepadButtonPressed(id int, button GamepadButton) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (in *input) Touches() []Touch {
|
func (in *input) Touches() []Touch {
|
||||||
|
i.m.RLock()
|
||||||
|
defer i.m.RUnlock()
|
||||||
t := make([]Touch, len(in.touches))
|
t := make([]Touch, len(in.touches))
|
||||||
for i := 0; i < len(t); i++ {
|
for i := 0; i < len(t); i++ {
|
||||||
t[i] = &in.touches[i]
|
t[i] = &in.touches[i]
|
||||||
|
Loading…
Reference in New Issue
Block a user