Skip to content

Commit

Permalink
Merge pull request #390 from koenbok/issue/2225
Browse files Browse the repository at this point in the history
Fix all edge swipe gestures
  • Loading branch information
koenbok committed Jul 28, 2016
2 parents b9e8d14 + 5258979 commit f3cfea6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions framer/GestureInputRecognizer.coffee
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -237,16 +237,14 @@ class exports.GestureInputRecognizer
@_dispatchEvent("swipe#{direction}start", event) @_dispatchEvent("swipe#{direction}start", event)


swipeEdge = @_edgeForSwipeDirection(direction) swipeEdge = @_edgeForSwipeDirection(direction)
maxX = Utils.frameGetMaxX(Screen.canvasFrame)
maxY = Utils.frameGetMaxY(Screen.canvasFrame)


if swipeEdge is "top" and 0 < event.start.y - Screen.canvasFrame.y < GestureInputEdgeSwipeDistance if swipeEdge is "top" and 0 < event.start.y < GestureInputEdgeSwipeDistance
@edgeswipedirectionstart(event) @edgeswipedirectionstart(event)
if swipeEdge is "right" and maxX - GestureInputEdgeSwipeDistance < event.start.x < maxX if swipeEdge is "right" and Screen.width - GestureInputEdgeSwipeDistance < event.start.x < Screen.width
@edgeswipedirectionstart(event) @edgeswipedirectionstart(event)
if swipeEdge is "bottom" and maxY - GestureInputEdgeSwipeDistance < event.start.y < maxY if swipeEdge is "bottom" and Screen.height - GestureInputEdgeSwipeDistance < event.start.y < Screen.height
@edgeswipedirectionstart(event) @edgeswipedirectionstart(event)
if swipeEdge is "left" and 0 < event.start.x - Screen.canvasFrame.x < GestureInputEdgeSwipeDistance if swipeEdge is "left" and 0 < event.start.x < GestureInputEdgeSwipeDistance
@edgeswipedirectionstart(event) @edgeswipedirectionstart(event)


swipedirection: (event) => swipedirection: (event) =>
Expand Down

0 comments on commit f3cfea6

Please sign in to comment.