From 01e05f3c945383b64e02dc730ed48a597650e087 Mon Sep 17 00:00:00 2001 From: cutealien Date: Wed, 19 Apr 2023 15:17:39 +0000 Subject: [PATCH] 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 --- source/Irrlicht/CGUIListBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp index 583facdc..5886b4ba 100644 --- a/source/Irrlicht/CGUIListBox.cpp +++ b/source/Irrlicht/CGUIListBox.cpp @@ -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) {