mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
Fixed a crash when attempting to navigate multi-cell ComponentGrid entries.
This commit is contained in:
parent
dc18955b28
commit
f1ceb1c2fe
|
@ -334,14 +334,16 @@ bool ComponentGrid::moveCursor(glm::ivec2 dir)
|
|||
cursorEntry = getCellAt(mCursor);
|
||||
|
||||
// Multi-cell entries.
|
||||
if (dir.x < 0 && cursorEntry->dim.x > 1)
|
||||
mCursor.x = getCellAt(origCursor)->pos.x - cursorEntry->dim.x;
|
||||
if (dir.y < 0 && cursorEntry->dim.y > 1)
|
||||
mCursor.y = getCellAt(origCursor)->pos.y - cursorEntry->dim.y;
|
||||
if (cursorEntry != nullptr) {
|
||||
if (dir.x < 0 && cursorEntry->dim.x > 1)
|
||||
mCursor.x = getCellAt(origCursor)->pos.x - cursorEntry->dim.x;
|
||||
if (dir.y < 0 && cursorEntry->dim.y > 1)
|
||||
mCursor.y = getCellAt(origCursor)->pos.y - cursorEntry->dim.y;
|
||||
|
||||
if (cursorEntry && cursorEntry->canFocus && cursorEntry != currentCursorEntry) {
|
||||
onCursorMoved(origCursor, mCursor);
|
||||
return true;
|
||||
if (cursorEntry->canFocus && cursorEntry != currentCursorEntry) {
|
||||
onCursorMoved(origCursor, mCursor);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
mCursor += searchAxis;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue