From 0a54d638772336e3e4b1d030d8aead6e8ebba35d Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 11 Dec 2016 02:23:02 +0100 Subject: [PATCH] scroll by moving mouse --- src/yugecin/opsudance/ui/OptionsOverlay.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index ac15d78b..a6d7c329 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -262,6 +262,7 @@ public class OptionsOverlay { } public void mouseDragged(int oldx, int oldy, int newx, int newy) { + scrollOffset += oldy - newy; } public void mouseWheelMoved(int delta) { @@ -277,6 +278,10 @@ public class OptionsOverlay { } private void updateHoverOption(int mouseX, int mouseY) { + if (selectedOption != null) { + hoverOption = selectedOption; + return; + } hoverOption = null; if (mouseY < optionStartY || mouseX < optionStartX || mouseX > optionStartX + optionWidth) { return;