There was an error while loading. Please reload this page.
1 parent f51848d commit b83c3e3Copy full SHA for b83c3e3
1 file changed
src/main/kotlin/org/polyfrost/chatting/chat/ChatScrolling.kt
@@ -54,11 +54,11 @@ object ChatScrolling {
54
55
fun shift(delta: Int) {
56
if (!ChattingConfig.smoothScrolling || !initialized) return
57
- from += delta
58
- to += delta
59
- current += delta
+ from = (from + delta).coerceAtLeast(0f)
+ to = (to + delta).coerceAtLeast(0f)
+ current = (current + delta).coerceAtLeast(0f)
60
frozen = current.roundToInt()
61
}
62
63
- fun pos(): Int = frozen
+ fun pos(): Int = frozen.coerceAtLeast(0)
64
0 commit comments