Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(parallax): revert changes from #1023
  • Loading branch information
kindoflew committed Apr 21, 2021
commit 855715e00bb3b52f3df341dc45fef8d5181e2ce1
3 changes: 2 additions & 1 deletion packages/parallax/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export const ParallaxLayer = React.memo(
const layer = useMemoOne<IParallaxLayer>(
() => ({
setPosition(height, scrollTop, immediate = false) {
const distance = height * offset
const targetScroll = Math.floor(offset) * height
const distance = height * offset + targetScroll * speed
ctrl.start({
translate: -(scrollTop * speed) + distance,
config: parent.config,
Expand Down