adding a crashfix at touch gestures

This commit is contained in:
tibbi 2021-02-20 19:47:53 +01:00
parent c7bf17f3be
commit 42e5c91591
2 changed files with 10 additions and 3 deletions

View File

@ -57,6 +57,6 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.33.32' implementation 'com.simplemobiletools:commons:5.33.34'
implementation "androidx.print:print:1.0.0" implementation "androidx.print:print:1.0.0"
} }

View File

@ -270,8 +270,15 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
} }
val pointerIndex = event.findPointerIndex(mActivePointerId) val pointerIndex = event.findPointerIndex(mActivePointerId)
val x = event.getX(pointerIndex) val x: Float
val y = event.getY(pointerIndex) val y: Float
try {
x = event.getX(pointerIndex)
y = event.getY(pointerIndex)
} catch (e: Exception) {
return true
}
var newValueX = x var newValueX = x
var newValueY = y var newValueY = y