aboutsummaryrefslogtreecommitdiff
path: root/RoughlyEnoughItems-runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-12-11 20:08:10 +0800
committershedaniel <daniel@shedaniel.me>2020-12-11 20:08:10 +0800
commit14edd7e3f9e3716ff60e9d918760049c1313a485 (patch)
tree040fcd41d95cd9165930979b503d3d4f47ea026e /RoughlyEnoughItems-runtime/src/main/java
parent7da94ad55ba766a88b413f3320023bebd1529a6a (diff)
downloadRoughlyEnoughItems-14edd7e3f9e3716ff60e9d918760049c1313a485.tar.gz
RoughlyEnoughItems-14edd7e3f9e3716ff60e9d918760049c1313a485.tar.bz2
RoughlyEnoughItems-14edd7e3f9e3716ff60e9d918760049c1313a485.zip
Make mouse stack scrolling better
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-runtime/src/main/java')
-rw-r--r--RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java
index b977551e2..9a8383391 100644
--- a/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java
+++ b/RoughlyEnoughItems-runtime/src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java
@@ -368,10 +368,10 @@ public class EntryWidget extends Slot {
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
if (ScreenHelper.isWithinRecipeViewingScreen && entryStacks.size() > 1 && containsMouse(mouseX, mouseY)) {
if (amount < 0) {
- EntryWidget.stackDisplayOffset += 500;
+ EntryWidget.stackDisplayOffset = ((System.currentTimeMillis() + stackDisplayOffset) / 1000 - 1) * 1000;
return true;
} else if (amount > 0) {
- EntryWidget.stackDisplayOffset -= 500;
+ EntryWidget.stackDisplayOffset = ((System.currentTimeMillis() + stackDisplayOffset) / 1000 + 1) * 1000;
return true;
}
}