Fix spontaneous crashes in android station screen

This commit is contained in:
DBotThePony 2025-01-07 16:22:31 +07:00
parent ffa0e3d6d5
commit 6f67912041
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -450,6 +450,10 @@ private enum class PreviewScrollers(
LEFT_TO_RIGHT(
init = { it, random ->
it.xOffset = it.width
if (it.childrenRectHeight == 0f)
it.yOffset = 0f
else
it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f)
},
@ -462,6 +466,10 @@ private enum class PreviewScrollers(
RIGHT_TO_LEFT(
init = { it, random ->
it.xOffset = -it.childrenRectWidth
if (it.childrenRectHeight == 0f)
it.yOffset = 0f
else
it.yOffset = random.nextFloat(-it.childrenRectHeight + 18f, 0f)
},
@ -474,6 +482,10 @@ private enum class PreviewScrollers(
BOTTOM_TO_TOP(
init = { it, random ->
it.yOffset = -it.childrenRectHeight
if (it.childrenRectWidth == 0f)
it.xOffset = 0f
else
it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f)
},
@ -486,6 +498,10 @@ private enum class PreviewScrollers(
TOP_TO_BOTTOM(
init = { it, random ->
it.yOffset = it.height
if (it.childrenRectWidth == 0f)
it.xOffset = 0f
else
it.xOffset = random.nextFloat(-it.childrenRectWidth + 18f, 0f)
},