Skip to content

Commit

Permalink
Velocity 0 quick fix (#7)
Browse files Browse the repository at this point in the history
* Quick fix for zeroing velocity on end of movement

* 0.3.2
  • Loading branch information
ydaniv authored Dec 17, 2024
1 parent ccffd5a commit d002a30
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ class Pointer {

if (p < 1) {
this._nextTransitionTick = requestAnimationFrame(tick);
} else {
this.currentProgress.vx = 0;
this.currentProgress.vy = 0;
}

this.effect.tick(this.currentProgress);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kuliso",
"version": "0.3.1",
"version": "0.3.2",
"sideeffects": true,
"description": "Tiny library for performant pointer-driven or gyroscope-driven effects",
"main": "dist/index.cjs",
Expand Down
3 changes: 3 additions & 0 deletions src/Pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ export class Pointer {

if (p < 1) {
this._nextTransitionTick = requestAnimationFrame(tick);
} else {
this.currentProgress.vx = 0;
this.currentProgress.vy = 0;
}

this.effect.tick(this.currentProgress);
Expand Down

0 comments on commit d002a30

Please sign in to comment.