Browse Source
Merge pull request #2927 from MarchingCube/cache-hittest-delegate
Cache delegate used for hit testing.
pull/2929/head
Steven Kirk
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
1 deletions
-
src/Avalonia.Input/InputExtensions.cs
|
|
|
@ -13,6 +13,8 @@ namespace Avalonia.Input |
|
|
|
/// </summary>
|
|
|
|
public static class InputExtensions |
|
|
|
{ |
|
|
|
private static readonly Func<IVisual, bool> s_hitTestDelegate = IsHitTestVisible; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns the active input elements at a point on an <see cref="IInputElement"/>.
|
|
|
|
/// </summary>
|
|
|
|
@ -25,7 +27,7 @@ namespace Avalonia.Input |
|
|
|
{ |
|
|
|
Contract.Requires<ArgumentNullException>(element != null); |
|
|
|
|
|
|
|
return element.GetVisualsAt(p, IsHitTestVisible).Cast<IInputElement>(); |
|
|
|
return element.GetVisualsAt(p, s_hitTestDelegate).Cast<IInputElement>(); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|