From 2f3f4add2a645e368b7e4db9bd5d4cdc60da9cf4 Mon Sep 17 00:00:00 2001 From: sychic <47618543+Sychic@users.noreply.github.com> Date: Thu, 26 Oct 2023 10:51:51 -0400 Subject: [PATCH] ScrollComponent: fix wrong parenthesis --- .../kotlin/gg/essential/elementa/components/ScrollComponent.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/gg/essential/elementa/components/ScrollComponent.kt b/src/main/kotlin/gg/essential/elementa/components/ScrollComponent.kt index fc69cfe6..de81528e 100644 --- a/src/main/kotlin/gg/essential/elementa/components/ScrollComponent.kt +++ b/src/main/kotlin/gg/essential/elementa/components/ScrollComponent.kt @@ -435,7 +435,7 @@ class ScrollComponent constructor( var changed = false val offset = if (isHorizontal) ::horizontalOffset else ::verticalOffset val range = calculateOffsetRange(isHorizontal) - val newOffset = (if(range.isEmpty()) innerPadding else offset.get() + delta * pixelsPerScroll * currentScrollAcceleration).coerceIn(range) + val newOffset = if(range.isEmpty()) innerPadding else (offset.get() + delta * pixelsPerScroll * currentScrollAcceleration).coerceIn(range) if (newOffset != offset.get()) { changed = true offset.set(newOffset)