Fix recently broken scroll behaviour of listbox with moveOverSelect

This also fixes the combobox which users the listbox like that.
This got broken in [r6454] which had fixed the events send out by the listbox
Note: Still a bit strange behaviour when leaving the combobox at the bottom, but that was already that way in Irrlicht 1.8, so I've got to investigate that on it's own.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6463 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2023-04-19 15:17:39 +00:00
parent 41bc7a1430
commit ce3dcfde56

View File

@ -631,7 +631,7 @@ void CGUIListBox::recalculateScrollPos()
if (!AutoScroll)
return;
const s32 selPos = (Selected == -1 ? TotalItemHeight : Selected * ItemHeight) - ScrollBar->getPos();
const s32 selPos = (getSelected() == -1 ? TotalItemHeight : getSelected() * ItemHeight) - ScrollBar->getPos();
if (selPos < 0)
{