Browse Source

Allow for no hits when hit testing.

This can happen e.g. if mouse is captured and moves out of bounds of
window. Fixes #265.
pull/278/head
Steven Kirk 11 years ago
parent
commit
2470dc5f44
  1. 2
      src/Perspex.Input/InputExtensions.cs

2
src/Perspex.Input/InputExtensions.cs

@ -54,7 +54,7 @@ namespace Perspex.Input
/// <returns>The topmost <see cref="IInputElement"/> at the specified position.</returns>
public static IInputElement InputHitTest(this IInputElement element, Point p)
{
return element.GetInputElementsAt(p).First();
return element.GetInputElementsAt(p).FirstOrDefault();
}
private static IEnumerable<IInputElement> ZSort(IEnumerable<IInputElement> elements)

Loading…
Cancel
Save