adjust scrolling

This commit is contained in:
Skiftcha committed 2020-11-24 09:10:48 +03:00
1 parent 3ae2128564
commit 587afa8e1d
2 files changed
+3 -9

No files matched your search

@@ -78,8 +78,8 @@ public class GuiScrollbar {
if (x > displayX && x <= displayX + width) {
if (y > displayY && y <= displayY + scrollHeight) {
int currentScroll = (y - displayY);
currentScroll = Math.round(1.0f * currentScroll / scrollHeight) * getMaxScroll();
int currentScroll = (y - displayY - height / 2);
currentScroll = Math.round(1.0f * currentScroll * getMaxScroll() / (scrollHeight - height));
setCurrentScroll(applyRange(currentScroll));
}
}