Browse Source
Merge pull request #4925 from AvaloniaUI/fixes/dev-tools-real-hittest
devtools ctrl + shift dont return elements where IsHitTestVisible == false
pull/4934/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs
|
|
@ -76,7 +76,13 @@ namespace Avalonia.Diagnostics.Views |
|
|
if (e.Modifiers == modifiers) |
|
|
if (e.Modifiers == modifiers) |
|
|
{ |
|
|
{ |
|
|
var point = (Root as IInputRoot)?.MouseDevice?.GetPosition(Root) ?? default; |
|
|
var point = (Root as IInputRoot)?.MouseDevice?.GetPosition(Root) ?? default; |
|
|
var control = Root.GetVisualsAt(point, x => (!(x is AdornerLayer) && x.IsVisible)) |
|
|
|
|
|
|
|
|
var control = Root.GetVisualsAt(point, x => |
|
|
|
|
|
{ |
|
|
|
|
|
if (x is AdornerLayer || !x.IsVisible) return false; |
|
|
|
|
|
if (!(x is IInputElement ie)) return true; |
|
|
|
|
|
return ie.IsHitTestVisible; |
|
|
|
|
|
}) |
|
|
.FirstOrDefault(); |
|
|
.FirstOrDefault(); |
|
|
|
|
|
|
|
|
if (control != null) |
|
|
if (control != null) |
|
|
|