Fixed issue where a tap would transition PanZoomGestureRecognizer to Ended rather than Failed, firing a TouchCompleted for a touch that never started (and interfering with other gesture recognizers that the application might have added, e.g. a UITapGestureRecognizer)

This commit is contained in:
cclarke 2015-07-31 10:49:39 -07:00
Родитель 33e2958aaa
Коммит a14d65ef38
1 изменённых файлов: 18 добавлений и 2 удалений

Просмотреть файл

@ -193,7 +193,15 @@ namespace OxyPlot.MonoTouch
if (!this.activeTouches.Any())
{
this.TouchEventArgs = firstTouch.ToTouchEventArgs(this.View);
this.State = UIGestureRecognizerState.Ended;
if (this.State == UIGestureRecognizerState.Possible)
{
this.State = UIGestureRecognizerState.Failed;
}
else
{
this.State = UIGestureRecognizerState.Ended;
}
}
}
}
@ -228,7 +236,15 @@ namespace OxyPlot.MonoTouch
if (!this.activeTouches.Any())
{
this.TouchEventArgs = firstTouch.ToTouchEventArgs(this.View);
this.State = UIGestureRecognizerState.Cancelled;
if (this.State == UIGestureRecognizerState.Possible)
{
this.State = UIGestureRecognizerState.Failed;
}
else
{
this.State = UIGestureRecognizerState.Cancelled;
}
}
}
}