mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 06:06:41 +01:00
Smarter distancing for useScroll
This commit is contained in:
parent
0b6dd07eee
commit
25ff2b9176
1 changed files with 2 additions and 0 deletions
|
@ -41,10 +41,12 @@ export default function useScroll({
|
|||
const distanceFromStartPx = Math.min(
|
||||
clientDimension * distanceFromStart,
|
||||
scrollDimension,
|
||||
scrollStart,
|
||||
);
|
||||
const distanceFromEndPx = Math.min(
|
||||
clientDimension * distanceFromEnd,
|
||||
scrollDimension,
|
||||
scrollDimension - scrollStart - clientDimension,
|
||||
);
|
||||
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue