From 1862a439e28a6d7fc9810717f96d7689a0ce0b32 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Mon, 13 Jan 2020 14:59:56 +0000 Subject: [PATCH] Correctly offset scroll cursor positions Fixes #330 --- .../dan200/computercraft/client/gui/widgets/WidgetWrapper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java index df5c46f6b..4eeeaf8ee 100644 --- a/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java +++ b/src/main/java/dan200/computercraft/client/gui/widgets/WidgetWrapper.java @@ -55,7 +55,8 @@ public class WidgetWrapper implements IGuiEventListener @Override public boolean mouseScrolled( double x, double y, double delta ) { - return listener.mouseScrolled( x, y, delta ); + double dx = x - this.x, dy = y - this.y; + return dx >= 0 && dx < width && dy >= 0 && dy < height && listener.mouseScrolled( dx, dy, delta ); } @Override