Merge pull request #136 from fluddokt/KinecticScrolling
KineticScrolling Minor fixes
This commit is contained in:
commit
84ce2d1531
|
@ -1385,12 +1385,13 @@ public class SongMenu extends BasicGameState {
|
||||||
|
|
||||||
updateDrawnSongPosition();
|
updateDrawnSongPosition();
|
||||||
|
|
||||||
|
|
||||||
// make sure focusNode is on the screen
|
// make sure focusNode is on the screen
|
||||||
int val = focusNode.index + focusNode.beatmapIndex;
|
int val = focusNode.index + focusNode.beatmapIndex;
|
||||||
if (val <= startNode.index)
|
if (val * buttonOffset <= songScrolling.getPosition())
|
||||||
songScrolling.scrollToPosition(val * buttonOffset);
|
songScrolling.scrollToPosition(val * buttonOffset);
|
||||||
else if (val > startNode.index + MAX_SONG_BUTTONS - 1)
|
else if (val* buttonOffset - (footerY - headerY - buttonOffset) >= songScrolling.getPosition())
|
||||||
songScrolling.scrollToPosition((val - MAX_SONG_BUTTONS + 1) * buttonOffset);
|
songScrolling.scrollToPosition(val * buttonOffset - (footerY - headerY - buttonOffset));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Centers selected node
|
// Centers selected node
|
||||||
|
|
|
@ -103,6 +103,8 @@ public class KineticScrolling {
|
||||||
* @param newPosition the position to scroll to
|
* @param newPosition the position to scroll to
|
||||||
*/
|
*/
|
||||||
public void scrollToPosition(float newPosition) {
|
public void scrollToPosition(float newPosition) {
|
||||||
|
pressed();
|
||||||
|
released();
|
||||||
amplitude = newPosition - position;
|
amplitude = newPosition - position;
|
||||||
target = newPosition;
|
target = newPosition;
|
||||||
totalDelta = 0;
|
totalDelta = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user