ignore pointer up and down if zooming isnt enabled

This commit is contained in:
tibbi 2022-03-09 15:46:34 +01:00
parent 61588de69a
commit 056b39e923

View file

@ -182,12 +182,16 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
mWasMovingCanvasInGesture = false
}
MotionEvent.ACTION_POINTER_DOWN -> {
mWasMultitouch = true
mTouchSloppedBeforeMultitouch = mLastMotionEvent.isTouchSlop(pointerIndex, mStartX, mStartY)
if (mAllowMovingZooming) {
mWasMultitouch = true
mTouchSloppedBeforeMultitouch = mLastMotionEvent.isTouchSlop(pointerIndex, mStartX, mStartY)
}
}
MotionEvent.ACTION_POINTER_UP -> {
mIgnoreTouches = true
actionUp(!mWasScalingInGesture && !mWasMovingCanvasInGesture)
if (mAllowMovingZooming) {
mIgnoreTouches = true
actionUp(!mWasScalingInGesture && !mWasMovingCanvasInGesture)
}
}
}