mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-06-25 22:53:22 +00:00
Fix mouse_up not being fired on Fabric
This commit is contained in:
parent
7f34aff6bb
commit
77f62dac94
|
@ -105,6 +105,16 @@ public boolean keyPressed(int key, int scancode, int modifiers) {
|
|||
return super.keyPressed(key, scancode, modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(double x, double y, int button) {
|
||||
// Reimplement ContainerEventHandler.mouseReleased, as it's not called in vanilla (it is in Forge, but that
|
||||
// shouldn't matter).
|
||||
setDragging(false);
|
||||
var child = getChildAt(x, y);
|
||||
if (child.isPresent() && child.get().mouseReleased(x, y, button)) return true;
|
||||
|
||||
return super.mouseReleased(x, y, button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack stack, int mouseX, int mouseY, float partialTicks) {
|
||||
|
|
|
@ -184,7 +184,7 @@ public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
|||
lastMouseX = charX;
|
||||
lastMouseY = charY;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -203,7 +203,7 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, double v2,
|
|||
lastMouseY = charY;
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user