Fix not showing primary context menu on Visject surface if child control handled input event

This commit is contained in:
Wojtek Figat
2023-12-06 13:03:37 +01:00
parent af4c662738
commit 23a72f2ade

View File

@@ -533,6 +533,7 @@ namespace FlaxEditor.Surface
UpdateSelectionRectangle();
}
}
bool showPrimaryMenu = false;
if (_rightMouseDown && button == MouseButton.Right)
{
_rightMouseDown = false;
@@ -546,8 +547,7 @@ namespace FlaxEditor.Surface
_cmStartPos = location;
if (controlUnderMouse == null)
{
// Show primary context menu
ShowPrimaryMenu(_cmStartPos);
showPrimaryMenu = true;
}
}
_mouseMoveAmount = 0;
@@ -573,8 +573,13 @@ namespace FlaxEditor.Surface
return true;
}
// If none of the child controls handled this show the primary context menu
if (showPrimaryMenu)
{
ShowPrimaryMenu(_cmStartPos);
}
// Letting go of a connection or right clicking while creating a connection
if (!_isMovingSelection && _connectionInstigator != null && !IsPrimaryMenuOpened)
else if (!_isMovingSelection && _connectionInstigator != null && !IsPrimaryMenuOpened)
{
_cmStartPos = location;
Cursor = CursorType.Default;