1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-22 12:39:59 +00:00
This commit is contained in:
AnyOldName3 2024-03-15 16:31:02 +00:00
parent b5f61a119a
commit ddb2c15bc9

View File

@ -246,12 +246,12 @@ namespace MWGui
bool forward = (direction == D_Next || direction == D_Right || direction == D_Down);
auto index = found - keyFocusList.begin();
std::ptrdiff_t index{ found - keyFocusList.begin() };
index = forward ? (index + 1) : (index - 1);
if (wrap)
index = (index + keyFocusList.size()) % keyFocusList.size();
else
index = std::clamp<decltype(index)>(index, 0, keyFocusList.size() - 1);
index = std::clamp<std::ptrdiff_t>(index, 0, keyFocusList.size() - 1);
MyGUI::Widget* next = keyFocusList[index];
int vertdiff = next->getTop() - focus->getTop();