Don't focus if clicking on an empty part of the list

This commit is contained in:
Benau
2019-01-22 01:56:36 +08:00
parent bf05035904
commit 6ecd606e3f

View File

@@ -426,8 +426,11 @@ void CGUISTKListBox::selectNew(s32 ypos, bool onlyHover)
s32 oldSelected = Selected;
Selected = getItemAt(AbsoluteRect.UpperLeftCorner.X, ypos);
if (Selected < 0 && !Items.empty())
Selected = 0;
if (Selected == -1 || Items.empty())
{
Selected = -1;
return;
}
recalculateScrollPos();