Skip to content

Commit

Permalink
#78 prevent entering to SCROLLING state if both pan are disabled. (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
nil2l authored and natario1 committed Jan 23, 2019
1 parent 8be9443 commit 5f41755
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/src/main/java/com/otaliastudios/zoom/ZoomEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,11 @@ internal constructor(context: Context) : ViewTreeObserver.OnGlobalLayoutListener
*/
override fun onScroll(e1: MotionEvent, e2: MotionEvent,
@AbsolutePan distanceX: Float, @AbsolutePan distanceY: Float): Boolean {

if (!mHorizontalPanEnabled && !mVerticalPanEnabled) {
return false
}

var delta = AbsolutePoint(distanceX, distanceY)
if (setState(SCROLLING)) {
// Change sign, since we work with opposite values.
Expand Down

0 comments on commit 5f41755

Please sign in to comment.