1
0
forked from 0ad/0ad

Remember scroll position when re-opening dropdown lists.

This was SVN commit r12319.
This commit is contained in:
Deiz 2012-08-08 17:22:52 +00:00
parent eadd24b64b
commit 166255b744

View File

@ -150,9 +150,11 @@ void CDropDown::HandleMessage(SGUIMessage &Message)
if (!m_Open)
{
m_Open = true;
GetScrollBar(0).SetPos(0.f);
GetScrollBar(0).SetZ(GetBufferedZ());
GUI<int>::GetSetting(this, "selected", m_ElementHighlight);
// Start at the position of the selected item, if possible.
GetScrollBar(0).SetPos( m_ItemsYPositions.empty() ? 0 : m_ItemsYPositions[m_ElementHighlight] );
return; // overshadow
}
else