mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-01 07:09:41 +00:00
Review
This commit is contained in:
parent
b5f61a119a
commit
ddb2c15bc9
1 changed files with 2 additions and 2 deletions
|
@ -246,12 +246,12 @@ namespace MWGui
|
||||||
|
|
||||||
bool forward = (direction == D_Next || direction == D_Right || direction == D_Down);
|
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);
|
index = forward ? (index + 1) : (index - 1);
|
||||||
if (wrap)
|
if (wrap)
|
||||||
index = (index + keyFocusList.size()) % keyFocusList.size();
|
index = (index + keyFocusList.size()) % keyFocusList.size();
|
||||||
else
|
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];
|
MyGUI::Widget* next = keyFocusList[index];
|
||||||
int vertdiff = next->getTop() - focus->getTop();
|
int vertdiff = next->getTop() - focus->getTop();
|
||||||
|
|
Loading…
Reference in a new issue