Skip to content

Commit

Permalink
Don't cancel MouseScrolled.Post
Browse files Browse the repository at this point in the history
It's no longer cancellable, and you can't cancel it in Fabric either.
  • Loading branch information
YaLTeR committed Jul 12, 2022
1 parent 2c10082 commit 2fe9b08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/yalter/mousetweaks/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public static boolean onMouseDrag(Screen screen, double x, double y, MouseButton
* @param x Mouse X.
* @param y Mouse Y.
* @param scrollDelta The scroll delta.
* @return True if the event was handled and should be cancelled.
* @return True if the event was handled by Mouse Tweaks.
*/
public static boolean onMouseScrolled(Screen screen, double x, double y, double scrollDelta) {
updateScreen(screen);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/yalter/mousetweaks/forge/MouseTweaksForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public void onGuiMouseScrollPost(MouseScrolled.Post event) {
// than one with a bigger delta.
Logger.DebugLog("onGuiMouseScrollPost delta = " + event.getScrollDelta());

if (Main.onMouseScrolled(event.getScreen(), event.getMouseX(), event.getMouseY(), event.getScrollDelta()))
event.setCanceled(true);
// Post events aren't cancellable, but that's okay.
Main.onMouseScrolled(event.getScreen(), event.getMouseX(), event.getMouseY(), event.getScrollDelta());
}

@SubscribeEvent
Expand Down

0 comments on commit 2fe9b08

Please sign in to comment.