Limit the progressBar height when there are only a few buttons

This commit is contained in:
Username404 2021-05-23 13:48:35 +02:00
parent a973d8c001
commit 1c091b82ea
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -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