From 0278556947556a5d55454fbf584de949dad4ebc5 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Wed, 16 Sep 2015 15:42:00 -0400 Subject: [PATCH] Fixed a minor kinetic scrolling bug in the song menu. Added a missing "songScrolling.released()" call upon entering the song menu as the pressed state wasn't being cleared (causing an issue with the scroll wheel upon re-entering the state). Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/states/DownloadsMenu.java | 4 ++-- src/itdelatrisu/opsu/states/SongMenu.java | 5 +++-- src/itdelatrisu/opsu/ui/KineticScrolling.java | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/itdelatrisu/opsu/states/DownloadsMenu.java b/src/itdelatrisu/opsu/states/DownloadsMenu.java index 34cb17c8..495d0dff 100644 --- a/src/itdelatrisu/opsu/states/DownloadsMenu.java +++ b/src/itdelatrisu/opsu/states/DownloadsMenu.java @@ -796,8 +796,8 @@ public class DownloadsMenu extends BasicGameState { @Override public void mouseReleased(int button, int x, int y) { - startDownloadIndexPos.release(); - startResultPos.release(); + startDownloadIndexPos.released(); + startResultPos.released(); } @Override diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index a851ff7f..ea597cd1 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -739,8 +739,8 @@ public class SongMenu extends BasicGameState { @Override public void mouseReleased(int button, int x, int y) { - songScrolling.release(); - startScorePos.release(); + songScrolling.released(); + startScorePos.released(); } @Override @@ -1082,6 +1082,7 @@ public class SongMenu extends BasicGameState { selectOptionsButton.resetHover(); hoverOffset.setTime(0); hoverIndex = null; + songScrolling.released(); startScorePos.setPosition(0); beatmapMenuTimer = -1; searchTransitionTimer = SEARCH_TRANSITION_TIME; diff --git a/src/itdelatrisu/opsu/ui/KineticScrolling.java b/src/itdelatrisu/opsu/ui/KineticScrolling.java index ca26172e..062f6509 100644 --- a/src/itdelatrisu/opsu/ui/KineticScrolling.java +++ b/src/itdelatrisu/opsu/ui/KineticScrolling.java @@ -113,7 +113,7 @@ public class KineticScrolling { */ public void setPosition(float newPosition) { pressed(); - release(); + released(); target = newPosition; position = target; } @@ -139,7 +139,7 @@ public class KineticScrolling { /** * Call this when the mouse button has been released. */ - public void release() { + public void released() { if (!pressed) return; pressed = false;