Skip to content

Commit

Permalink
ScrollComponent: always try to scroll instead of only when in range
Browse files Browse the repository at this point in the history
  • Loading branch information
Sychic committed Oct 13, 2023
1 parent b5bc9ba commit 724f13e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ 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
if (newOffset in range) {
val newOffset = (if(range.isEmpty()) innerPadding else offset.get() + delta * pixelsPerScroll * currentScrollAcceleration).coerceIn(range)
if (newOffset != offset.get()) {
changed = true
offset.set(newOffset.coerceIn(range))
offset.set(newOffset)
}

currentScrollAcceleration =
Expand Down

0 comments on commit 724f13e

Please sign in to comment.