Fix sizeToContents not working properly when childrens are not docked

This commit is contained in:
DBotThePony 2025-02-13 20:56:18 +07:00
parent 89c7295abb
commit dd3a08f47d
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1404,7 +1404,14 @@ open class EditablePanel<out S : Screen>(
for (child in visibleChildrenInternal) {
when (child.dock) {
Dock.NONE, Dock.FILL -> {} // do nothing
Dock.NONE -> {
width = maxOf(width, child.x + child.width)
height = maxOf(height, child.y + child.height)
}
Dock.FILL -> {
throw RuntimeException()
} // do nothing
Dock.LEFT, Dock.RIGHT -> {
if (previousDock != 1) {