Adjust combobox window position based on what direction it opens.

This commit is contained in:
Chandler Cox
2024-01-22 21:01:04 -06:00
parent 1094abce5a
commit d5e9ad2147

View File

@@ -428,6 +428,13 @@ namespace FlaxEditor.GUI
// Show dropdown list
_popupMenu.MinimumWidth = Width;
_popupMenu.Show(this, new Float2(1, Height));
// Adjust menu position if it is not the down direction
if (_popupMenu.Direction == ContextMenuDirection.RightUp)
{
var position = _popupMenu.RootWindow.Window.Position;
_popupMenu.RootWindow.Window.Position = new Float2(position.X, position.Y - Height);
}
}
}