diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt index c365604..0e7694a 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickBox.kt @@ -46,7 +46,7 @@ class ClickBox( fun scroll(d: Double, e: Double, supplied: Double) { if (withinBounds(d, e, offsetHeight = clickboxHeightOffset.toDouble())) { with(buttonsProgressBar) { - if ((height > 8 || (supplied < 0)) && ((height < originalHeight) || (supplied > 0))) { + if ((height > 8 || (supplied < 0)) && (((height < (buttons.size * 8)) && (height < originalHeight)) || (supplied > 0))) { height -= supplied.toInt() if (buttons.isNotEmpty()) (height / 8).let { if (it > 0) barStage = it