diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/Buttons.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/Buttons.kt index e47742a7d..71295e837 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/Buttons.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/button/Buttons.kt @@ -353,8 +353,10 @@ class DeviceControls>( var totalWidth = 0f var totalHeight = 0f + val parent = parent!! + for (button in buttons) { - if (y != 0f && button.height + y > parent!!.height) { + if (y != 0f && button.height + y > parent.height && (parent.dock == Dock.NONE || !parent.layoutInvalidated)) { totalHeight = totalHeight.coerceAtLeast(y - 2f) y = 0f x += currentWidth + 2f