Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ class RotationGestureHandler : GestureHandler() {
override fun onRotationBegin(detector: RotationGestureDetector) = true

override fun onRotationEnd(detector: RotationGestureDetector) {
end()
if (state == STATE_ACTIVE) {
end()
} else {
fail()
}
}
}

Expand Down Expand Up @@ -64,12 +68,11 @@ class RotationGestureHandler : GestureHandler() {
anchorX = point.x
anchorY = point.y
}
if (sourceEvent.actionMasked == MotionEvent.ACTION_UP) {
if (state == STATE_ACTIVE) {
end()
} else {
fail()
}

// ACTION_UP is already handled in rotationGestureDetector.onTouchEvent (and effectively in onRotationEnd)
// if more than one pointer was used
if (sourceEvent.actionMasked == MotionEvent.ACTION_UP && state == STATE_BEGAN) {
fail()
}
}

Expand Down
Loading