mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 21:40:42 +00:00
Review
This commit is contained in:
parent
b5f61a119a
commit
ddb2c15bc9
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user