Skip to content

Commit

Permalink
targetPage was return currentPage even if currentPageOffset was negat…
Browse files Browse the repository at this point in the history
…ive (#712)

* targetPage was return currentPage even if currentPageOffset was negative

* Update fix to not create an IntRange every call

Co-authored-by: Chris Banes <chrisbanes@users.noreply.github.com>
  • Loading branch information
RareScrap and chrisbanes committed Sep 13, 2021
1 parent 7aea622 commit 89db790
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -265,7 +265,7 @@ class PagerState(
// If a scroll isn't in progress, return the current page
!isScrollInProgress -> currentPage
// If the offset is 0f (or very close), return the current page
currentPageOffset < 0.001f -> currentPage
currentPageOffset.absoluteValue < 0.001f -> currentPage
// If we're offset towards the start, guess the previous page
currentPageOffset < 0 -> (currentPage - 1).coerceAtLeast(0)
// If we're offset towards the end, guess the next page
Expand Down

0 comments on commit 89db790

Please sign in to comment.