Browse Source

Don't return detached controls in HitTest.

If a control has been detached from the visual tree but the scene hasn't yet been updated, don't return the control as part of a hit-test.
pull/1210/head
Steven Kirk 9 years ago
parent
commit
aa2980b8c8
  1. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs

2
src/Avalonia.Visuals/Rendering/SceneGraph/Scene.cs

@ -173,7 +173,7 @@ namespace Avalonia.Rendering.SceneGraph
}
}
if (node.HitTest(p))
if (node.HitTest(p) && node.Visual.IsAttachedToVisualTree)
{
yield return node.Visual;
}

Loading…
Cancel
Save