1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

no old selection

This commit is contained in:
Michael 2023-08-09 00:41:13 +02:00 committed by GitHub
parent 8693dab9ec
commit 6013549ef8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -512,6 +512,12 @@ void SelectionTab::select(int position)
filter(-1); filter(-1);
slider->scrollTo(0); slider->scrollTo(0);
int firstPos = boost::range::find_if(curItems, [](std::shared_ptr<ElementInfo> e) { return !e->isFolder; }) - curItems.begin();
if(firstPos < curItems.size())
{
selectAbs(firstPos);
}
return; return;
} }