Skip to content

Commit dac5dce

Browse files
authored
WScrollBar: Allow mousewheel scrolling (#90)
1 parent 079affc commit dac5dce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/io/github/cottonmc/cotton/gui/widget/WScrollBar.java

+6
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ public void onKeyPressed(int ch, int key, int modifiers) {
214214
}
215215
}
216216

217+
@Environment(EnvType.CLIENT)
218+
@Override
219+
public void onMouseScroll(int x, int y, double amount) {
220+
setValue(getValue() + (int) -amount);
221+
}
222+
217223
public int getValue() {
218224
return value;
219225
}

0 commit comments

Comments
 (0)