Commit 34a9ff2f authored by bitplane's avatar bitplane

Ensure ListBox on combo box doesn't hang off the bottom of the GUI root, by Matthias Specht

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2246 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d1f61e31
......@@ -423,6 +423,10 @@ void CGUIComboBox::openCloseMenu()
ListBox->setSubElement(true);
ListBox->drop();
// ensure that list box is always completely visible
if (ListBox->getAbsolutePosition().LowerRightCorner.Y > Environment->getRootGUIElement()->getAbsolutePosition().getHeight())
ListBox->setRelativePosition( core::rect<s32>(0, -AbsoluteRect.getHeight(), AbsoluteRect.getWidth(), 0) );
for (s32 i=0; i<(s32)Items.size(); ++i)
ListBox->addItem(Items[i].Name.c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment