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
parent
commit
45bbee6f88
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs

8
src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs

@ -76,7 +76,13 @@ namespace Avalonia.Diagnostics.Views
if (e.Modifiers == modifiers)
{
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();
if (control != null)

Loading…
Cancel
Save