Skip to content

Commit

Permalink
fixed swipe navigation glitches
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzybojad committed Sep 3, 2019
1 parent c427f48 commit 6301f55
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ namespace Input
if( buttonWasPressed[ static_cast<int>( Button::frontTouch ) ] )
{
touchOrigin = touchPos;

buttonIsHeld[ static_cast<int>( Button::swipeRight ) ] = false;
buttonIsHeld[ static_cast<int>( Button::swipeUp ) ] = false;
buttonIsHeld[ static_cast<int>( Button::swipeLeft ) ] = false;
buttonIsHeld[ static_cast<int>( Button::swipeDown ) ] = false;
}
else
{
Expand All @@ -94,7 +99,13 @@ namespace Input
buttonIsHeld[ static_cast<int>( Button::swipeDown ) ] = ( angle > 3 * M_PI / 8 && angle < 5 * M_PI / 8 );
}
}

}
else
{
buttonIsHeld[ static_cast<int>( Button::swipeRight ) ] = false;
buttonIsHeld[ static_cast<int>( Button::swipeUp ) ] = false;
buttonIsHeld[ static_cast<int>( Button::swipeLeft ) ] = false;
buttonIsHeld[ static_cast<int>( Button::swipeDown ) ] = false;
}

// Set "was pressed" values for swipes
Expand Down

0 comments on commit 6301f55

Please sign in to comment.