mirror of
https://github.com/exyte/Macaw.git
synced 2024-10-26 13:01:25 +03:00
Avoid force unwrapping of the initial touch index
This commit is contained in:
parent
654df3ab69
commit
46d8a81739
@ -296,7 +296,9 @@ open class MacawView: MView, MGestureRecognizerDelegate {
|
|||||||
|
|
||||||
var points = [TouchPoint]()
|
var points = [TouchPoint]()
|
||||||
for initialTouch in initialTouches {
|
for initialTouch in initialTouches {
|
||||||
let currentIndex = touches.index(of: initialTouch)!
|
guard let currentIndex = touches.index(of: initialTouch) else {
|
||||||
|
continue
|
||||||
|
}
|
||||||
let currentTouch = touches[currentIndex]
|
let currentTouch = touches[currentIndex]
|
||||||
let location = CGPoint(x: currentTouch.x, y: currentTouch.y)
|
let location = CGPoint(x: currentTouch.x, y: currentTouch.y)
|
||||||
let inverted = currentNode.place.invert()!
|
let inverted = currentNode.place.invert()!
|
||||||
|
Loading…
Reference in New Issue
Block a user