|
|
@@ -133,7 +133,11 @@ class EmojiRainView @JvmOverloads constructor(
|
|
|
val section = random.nextInt(sections)
|
|
|
val minX = section * sectionWidth
|
|
|
val maxX = (section + 1) * sectionWidth - emoji.width
|
|
|
- x = (minX + random.nextInt(maxX - minX + 1)).toFloat()
|
|
|
+ x = if(maxX <= minX) {
|
|
|
+ minX.toFloat()
|
|
|
+ } else {
|
|
|
+ (minX + random.nextInt(maxX - minX + 1)).toFloat()
|
|
|
+ }
|
|
|
y = -emoji.height.toFloat() - random.nextInt(100)
|
|
|
|
|
|
attempts++
|