Minor bug in AndroidInput

I found a bug at AndroidInput.java(line:264)

[java]
case MotionEvent.ACTION_MOVE:
// Convert all pointers into events
for (int p = 0; p < event.getPointerCount(); p++) {
lastPos = lastPositions.get§;
if (lastPos == null) {
lastPos = new Vector2f(event.getX§, view.getHeight() - event.getY§);
lastPositions.put(event.getPointerId§, lastPos);
}
[/java]

I think this should be as follows…

[java]
case MotionEvent.ACTION_MOVE:
// Convert all pointers into events
for (int p = 0; p < event.getPointerCount(); p++) {
lastPos = lastPositions.get(event.getPointerId§);
if (lastPos == null) {
lastPos = new Vector2f(event.getX§, view.getHeight() - event.getY§);
lastPositions.put(event.getPointerId§, lastPos);
}
[/java]

This problem is as follows.
for example, first finger touched and moved then, second finger touched and moved.
then after first finger release, second finger's event never occur.

(as you see, I am not good at English :P)

2 Likes

Thanks. I’ll take a look at this.

@kumasao. I committed your change. Thanks for finding it!

@kumasao. I committed your change. Thanks for finding it!

2 Likes