Skip to content

Commit

Permalink
Merge pull request #471 from aure/master
Browse files Browse the repository at this point in the history
Avoiding crash on multi-touch
  • Loading branch information
ystrot authored Sep 4, 2018
2 parents 2defb30 + 46d8a81 commit af9727e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/views/MacawView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,9 @@ open class MacawView: MView, MGestureRecognizerDelegate {

var points = [TouchPoint]()
for initialTouch in initialTouches {
let currentIndex = touches.index(of: initialTouch)!
guard let currentIndex = touches.index(of: initialTouch) else {
continue
}
let currentTouch = touches[currentIndex]
let location = CGPoint(x: currentTouch.x, y: currentTouch.y)
let inverted = currentNode.place.invert()!
Expand Down

0 comments on commit af9727e

Please sign in to comment.