diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/tech/AndroidStationScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/tech/AndroidStationScreen.kt index 00c0c85d8..16acceee3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/tech/AndroidStationScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/tech/AndroidStationScreen.kt @@ -450,7 +450,11 @@ private enum class PreviewScrollers( LEFT_TO_RIGHT( init = { it, random -> it.xOffset = it.width - it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f) + + if (it.childrenRectHeight == 0f) + it.yOffset = 0f + else + it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f) }, scroll = { it, _ -> @@ -462,7 +466,11 @@ private enum class PreviewScrollers( RIGHT_TO_LEFT( init = { it, random -> it.xOffset = -it.childrenRectWidth - it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f) + + if (it.childrenRectHeight == 0f) + it.yOffset = 0f + else + it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f) }, scroll = { it, _ -> @@ -474,7 +482,11 @@ private enum class PreviewScrollers( BOTTOM_TO_TOP( init = { it, random -> it.yOffset = -it.childrenRectHeight - it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f) + + if (it.childrenRectWidth == 0f) + it.xOffset = 0f + else + it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f) }, scroll = { it, _ -> @@ -486,7 +498,11 @@ private enum class PreviewScrollers( TOP_TO_BOTTOM( init = { it, random -> it.yOffset = it.height - it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f) + + if (it.childrenRectWidth == 0f) + it.xOffset = 0f + else + it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f) }, scroll = { it, _ ->