fix some scrolling issues
@@ -252,7 +252,6 @@ public class BlockChangeDetectorScreen extends AbstractContainerScreen<BlockChan
height += entry.getHeight();
}
- if (getContentHeight() > this.height)
applyScrollLimits();
}
@@ -299,11 +298,11 @@ public class BlockChangeDetectorScreen extends AbstractContainerScreen<BlockChan
if (maxScroll < 0)
maxScroll /= 2;
- if (scrollDistance < 0.0F)
- scrollDistance = 0.0F;
-
if (scrollDistance > maxScroll)
scrollDistance = maxScroll;
+
+ if (scrollDistance < 0.0F)
+ scrollDistance = 0.0F;
}
public void updateFilteredEntries() {
@@ -328,6 +327,22 @@ public class BlockChangeDetectorScreen extends AbstractContainerScreen<BlockChan
recalculateContentHeight = true;
}
+ @Override
+ public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
+ if (getContentHeight() < height)
+ return false;
+
+ return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
+ }
+
+ @Override
+ public boolean mouseScrolled(double mouseX, double mouseY, double scroll) {
+ if (getContentHeight() < height)
+ return false;
+
+ return super.mouseScrolled(mouseX, mouseY, scroll);
+ }
+
@Override
public NarrationPriority narrationPriority() {
return NarrationPriority.NONE;
