iOS: Detect/handle cancellation of subset of touch points

Change-Id: I0d345d07fe62a8c7844333bf1eed9be6d6fa432f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-11-07 13:15:31 +01:00 committed by The Qt Project
parent 24d1f58414
commit 59be0509e0

View File

@ -226,10 +226,16 @@
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
Q_UNUSED(touches) // ### can a subset of the active touches be cancelled?
if (!touches) {
m_activeTouches.clear();
} else {
for (UITouch *touch in touches)
m_activeTouches.remove(touch);
Q_ASSERT_X(m_activeTouches.isEmpty(), Q_FUNC_INFO,
"Subset of active touches cancelled by UIKit");
}
// Clear current touch points
m_activeTouches.clear();
m_nextTouchId = 0;
// Send cancel touch event synchronously