make MultiTouch code more restrictive
This commit is contained in:
parent
f7cc56be00
commit
3e173eddd1
1 changed files with 33 additions and 34 deletions
|
@ -88,10 +88,10 @@ public class MultiTouchSupport {
|
||||||
if(inZoomMode){
|
if(inZoomMode){
|
||||||
listener.onZoomOrRotationEnded(zoomRelative, angleRelative);
|
listener.onZoomOrRotationEnded(zoomRelative, angleRelative);
|
||||||
inZoomMode = false;
|
inZoomMode = false;
|
||||||
//return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (pointCount == 2) {
|
||||||
Float x1 = (Float) getX.invoke(event, 0);
|
Float x1 = (Float) getX.invoke(event, 0);
|
||||||
Float x2 = (Float) getX.invoke(event, 1);
|
Float x2 = (Float) getX.invoke(event, 1);
|
||||||
Float y1 = (Float) getY.invoke(event, 0);
|
Float y1 = (Float) getY.invoke(event, 0);
|
||||||
|
@ -111,12 +111,12 @@ public class MultiTouchSupport {
|
||||||
angleStarted = angle;
|
angleStarted = angle;
|
||||||
inZoomMode = true;
|
inZoomMode = true;
|
||||||
return true;
|
return true;
|
||||||
} else if(actionCode == ACTION_POINTER_UP){
|
//} else if(actionCode == ACTION_POINTER_UP){
|
||||||
if(inZoomMode){
|
// if(inZoomMode){
|
||||||
listener.onZoomOrRotationEnded(zoomRelative, angleRelative);
|
// listener.onZoomOrRotationEnded(zoomRelative, angleRelative);
|
||||||
inZoomMode = false;
|
// inZoomMode = false;
|
||||||
}
|
// }
|
||||||
return true;
|
// return true;
|
||||||
} else if(inZoomMode && actionCode == MotionEvent.ACTION_MOVE){
|
} else if(inZoomMode && actionCode == MotionEvent.ACTION_MOVE){
|
||||||
if(angleDefined) {
|
if(angleDefined) {
|
||||||
angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted);
|
angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted);
|
||||||
|
@ -124,8 +124,7 @@ public class MultiTouchSupport {
|
||||||
zoomRelative = distance / zoomStartedDistance;
|
zoomRelative = distance / zoomStartedDistance;
|
||||||
listener.onZoomingOrRotating(zoomRelative, angleRelative);
|
listener.onZoomingOrRotating(zoomRelative, angleRelative);
|
||||||
return true;
|
return true;
|
||||||
} else if (pointCount >= 2) {
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("Multi touch exception" , e); //$NON-NLS-1$
|
log.debug("Multi touch exception" , e); //$NON-NLS-1$
|
||||||
|
|
Loading…
Reference in a new issue