mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-22 05:44:31 -04:00
some improvements to screen navigation
This commit is contained in:
parent
799a701fc3
commit
ec23dd8edf
1 changed files with 17 additions and 1 deletions
|
@ -142,7 +142,23 @@ static int32_t rect_distances(
|
|||
return -1;
|
||||
}
|
||||
|
||||
return (std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * (on_axis_distance + 1);
|
||||
|
||||
switch(direction) {
|
||||
case KeyEvent::Right:
|
||||
case KeyEvent::Left:
|
||||
return ((std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) ^ 3) * sqrt((on_axis_distance + 1));
|
||||
break;
|
||||
|
||||
case KeyEvent::Up:
|
||||
case KeyEvent::Down:
|
||||
return (sqrt(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1)) * ((on_axis_distance + 1) ^ 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void FocusManager::update(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue