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 committed by sfan5
parent b673a4b2bb
commit 01e05f3c94
1 changed files with 1 additions and 1 deletions

View File

@ -623,7 +623,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)
{