mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-25 14:08:23 -05:00
Improved Focus Manager navigation (#1589)
* Focus manager navigation fix * Add files via upload
This commit is contained in:
parent
9e6699d8cc
commit
2c0446e83d
@ -30,6 +30,8 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#define pow2(x) ((x) * (x))
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
Widget* FocusManager::focus_widget() const {
|
Widget* FocusManager::focus_widget() const {
|
||||||
@ -138,12 +140,12 @@ static int32_t rect_distances(
|
|||||||
switch (direction) {
|
switch (direction) {
|
||||||
case KeyEvent::Right:
|
case KeyEvent::Right:
|
||||||
case KeyEvent::Left:
|
case KeyEvent::Left:
|
||||||
return ((std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) ^ 3) * sqrt((on_axis_distance + 1));
|
return pow2(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * (on_axis_distance + 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyEvent::Up:
|
case KeyEvent::Up:
|
||||||
case KeyEvent::Down:
|
case KeyEvent::Down:
|
||||||
return (sqrt(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1)) * ((on_axis_distance + 1) ^ 3);
|
return (std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * pow2(on_axis_distance + 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user