Fix right clicking on Visject boxes

Previously, the primary context menu would get triggered when right clicking on a box, causing some issues
This commit is contained in:
stefnotch
2021-01-11 16:23:02 +01:00
parent 7112160de5
commit ab4195ab6c

View File

@@ -99,18 +99,6 @@ namespace FlaxEditor.Surface
/// </summary>
public event Window.MouseWheelDelegate CustomMouseWheel;
/// <summary>
/// Gets the node under the mouse location.
/// </summary>
/// <returns>The node or null if no intersection.</returns>
public SurfaceNode GetNodeUnderMouse()
{
var pos = _rootControl.PointFromParent(ref _mousePos);
if (_rootControl.GetChildAt(pos) is SurfaceNode node)
return node;
return null;
}
/// <summary>
/// Gets the control under the mouse location.
/// </summary>
@@ -118,9 +106,7 @@ namespace FlaxEditor.Surface
public SurfaceControl GetControlUnderMouse()
{
var pos = _rootControl.PointFromParent(ref _mousePos);
if (_rootControl.GetChildAtRecursive(pos) is SurfaceControl control)
return control;
return null;
return _rootControl.GetChildAt(pos) as SurfaceControl;
}
private void UpdateSelectionRectangle()