Skip to content

Commit

Permalink
Fix creative tab scrolling being broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Siphalor committed Mar 25, 2022
1 parent d6c1a18 commit cf1d917
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ public MixinCreativeInventoryScreen(CreativeInventoryScreen.CreativeScreenHandle
@Override
public ScrollAction mouseWheelie_onMouseScrolledSpecial(double mouseX, double mouseY, double scrollAmount) {
if (MWConfig.scrolling.scrollCreativeMenuTabs) {
boolean yOverTopTabs = (-32 <= mouseY && mouseY <= 0);
boolean yOverBottomTabs = (this.backgroundHeight <= mouseY && mouseY <= this.backgroundHeight + 32);
boolean overTabs = (0 <= mouseX && mouseX <= this.backgroundWidth) && (yOverTopTabs || yOverBottomTabs);
double relMouseY = mouseY - this.y;
double relMouseX = mouseX - this.x;
boolean yOverTopTabs = (-32 <= relMouseY && relMouseY <= 0);
boolean yOverBottomTabs = (this.backgroundHeight <= relMouseY && relMouseY <= this.backgroundHeight + 32);
boolean overTabs = (0 <= relMouseX && relMouseX <= this.backgroundWidth) && (yOverTopTabs || yOverBottomTabs);

if (overTabs) {
if (FabricLoader.getInstance().isModLoaded("fabric") || FabricLoader.getInstance().isModLoaded("fabric-item-groups")) {
Expand Down

0 comments on commit cf1d917

Please sign in to comment.