diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/pro/views/MyCanvas.kt b/app/src/main/kotlin/com/simplemobiletools/draw/pro/views/MyCanvas.kt index 21bcdad..4ff6e70 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/pro/views/MyCanvas.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/pro/views/MyCanvas.kt @@ -60,6 +60,7 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { private var mIsBucketFillOn = false private var mWasMultitouch = false private var mIgnoreTouches = false + private var mIgnoreMultitouchChanges = false private var mWasScalingInGesture = false private var mWasMovingCanvasInGesture = false private var mBackgroundColor = 0 @@ -160,7 +161,7 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { actionMove(newValueX, newValueY) } - if (mAllowMovingZooming && mWasMultitouch) { + if (mAllowMovingZooming && mWasMultitouch && !mIgnoreMultitouchChanges) { mPosX += x - mLastTouchX mPosY += y - mLastTouchY mWasMovingCanvasInGesture = true @@ -169,6 +170,7 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { mLastTouchX = x mLastTouchY = y + mIgnoreMultitouchChanges = false } MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> { mActivePointerId = INVALID_POINTER_ID @@ -179,12 +181,14 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { MotionEvent.ACTION_POINTER_DOWN -> { if (mAllowMovingZooming) { mWasMultitouch = true + mIgnoreMultitouchChanges = true mTouchSloppedBeforeMultitouch = mLastMotionEvent.isTouchSlop(pointerIndex, mStartX, mStartY) } } MotionEvent.ACTION_POINTER_UP -> { if (mAllowMovingZooming) { mIgnoreTouches = true + mIgnoreMultitouchChanges = true actionUp(!mWasScalingInGesture && !mWasMovingCanvasInGesture) } }