Add raycast-first priority to the UIEditorGizmo

This commit is contained in:
Amir Alizadeh
2025-01-19 23:55:23 +03:30
parent f17d6f62ab
commit 55fd198102

View File

@@ -714,16 +714,15 @@ namespace FlaxEditor
private bool RayCastControl(ref Float2 location, out Control hit)
{
#if false
// Raycast only controls with content (eg. skips transparent panels)
return RayCastChildren(ref location, out hit);
#else
// Find any control under mouse (hierarchical)
hit = GetChildAtRecursive(location);
// First, raycast only controls with content (eg. skips transparent panels)
RayCastChildren(ref location, out hit);
// If raycast failed, then find any control under mouse (hierarchical)
hit = hit ?? GetChildAtRecursive(location);
if (hit is View || hit is CanvasContainer)
hit = null;
return hit != null;
#endif
}
private UIControlNode FindUIControlNode(Control control)