aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java
index 8687c52..cfcdfc1 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java
@@ -130,8 +130,7 @@ public class WScrollBar extends WWidget {
}
public int pixelsToValues(int pixels) {
- int bar = (axis==Axis.HORIZONTAL) ? width-2 : height-2;
- //int bar = getMovableDistance();
+ int bar = getMovableDistance();
float percent = pixels / (float)bar;
return (int)(percent*(maxValue-window));
}