From ebe847c04bf8cd83390dd230d98781706d9cb8e9 Mon Sep 17 00:00:00 2001 From: Nikita Savyolov Date: Sun, 10 Oct 2021 23:28:07 +0300 Subject: [PATCH] fix: mouseUp (mouseReleased) event mouseReleased doesn't work at ClickableWidget, why? --- .../dan200/computercraft/client/gui/ComputerScreenBase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java b/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java index 1373bbc61..6ff568413 100644 --- a/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java +++ b/src/main/java/dan200/computercraft/client/gui/ComputerScreenBase.java @@ -108,6 +108,12 @@ public abstract class ComputerScreenBase extend return getFocused() != null && getFocused().mouseDragged( x, y, button, deltaX, deltaY ) || super.mouseDragged( x, y, button, deltaX, deltaY ); } + @Override + public boolean mouseReleased( double mouseX, double mouseY, int button ) + { + return (getFocused() != null && getFocused().mouseReleased( mouseX, mouseY, button )) || super.mouseReleased( x, y, button ); + } + @Override protected void drawForeground( @Nonnull MatrixStack transform, int mouseX, int mouseY ) {