mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
Minor cleanup in MoveFocus, set tags on screen roots for debugging
This commit is contained in:
1 parent
26e097923d
commit
f27850ec1d
4 files changed
+14
-21
No files matched your search
+10
-20
@@ -418,25 +418,6 @@ NeighborResult ViewGroup::FindNeighbor(View *view, FocusDirection direction, Nei
|
||||
}
|
||||
}
|
||||
|
||||
if (direction == FOCUS_PREV || direction == FOCUS_NEXT) {
|
||||
switch (direction) {
|
||||
case FOCUS_PREV:
|
||||
// If view not found, no neighbor to find.
|
||||
if (num == -1)
|
||||
return NeighborResult(nullptr, 0.0f);
|
||||
return NeighborResult(views_[(num + views_.size() - 1) % views_.size()], 0.0f);
|
||||
|
||||
case FOCUS_NEXT:
|
||||
// If view not found, no neighbor to find.
|
||||
if (num == -1)
|
||||
return NeighborResult(0, 0.0f);
|
||||
return NeighborResult(views_[(num + 1) % views_.size()], 0.0f);
|
||||
default:
|
||||
// Can't happen
|
||||
return NeighborResult(nullptr, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
switch (direction) {
|
||||
case FOCUS_UP:
|
||||
case FOCUS_LEFT:
|
||||
@@ -472,10 +453,19 @@ NeighborResult ViewGroup::FindNeighbor(View *view, FocusDirection direction, Nei
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
case FOCUS_PREV_PAGE:
|
||||
case FOCUS_NEXT_PAGE:
|
||||
return FindScrollNeighbor(view, Point(INFINITY, INFINITY), direction, result);
|
||||
case FOCUS_PREV:
|
||||
// If view not found, no neighbor to find.
|
||||
if (num == -1)
|
||||
return NeighborResult(nullptr, 0.0f);
|
||||
return NeighborResult(views_[(num + views_.size() - 1) % views_.size()], 0.0f);
|
||||
case FOCUS_NEXT:
|
||||
// If view not found, no neighbor to find.
|
||||
if (num == -1)
|
||||
return NeighborResult(0, 0.0f);
|
||||
return NeighborResult(views_[(num + 1) % views_.size()], 0.0f);
|
||||
|
||||
default:
|
||||
ERROR_LOG(SYSTEM, "Bad focus direction %d", (int)direction);
|
||||
|
||||
Reference in new issue
Block a user