Skip to content

Commit

Permalink
Fix #723 jerk when panning with inertia enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Aug 19, 2022
1 parent 107f7a4 commit 3bdb207
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/EventsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,17 +814,17 @@ export class EventsHandler extends AbstractService {
let previous = null;

for (let i = 0; i < this.state.mouseHistory.length;) {
if (this.state.mouseHistory[0][i] < now - INERTIA_WINDOW) {
if (this.state.mouseHistory[i][0] < now - INERTIA_WINDOW) {
this.state.mouseHistory.splice(i, 1);
}
else if (previous && this.state.mouseHistory[0][i] - previous > INERTIA_WINDOW / 10) {
else if (previous && this.state.mouseHistory[i][0] - previous > INERTIA_WINDOW / 10) {
this.state.mouseHistory.splice(0, i);
i = 0;
previous = this.state.mouseHistory[0][i];
previous = this.state.mouseHistory[i][0];
}
else {
previous = this.state.mouseHistory[i][0];
i++;
previous = this.state.mouseHistory[0][i];
}
}
}
Expand Down

0 comments on commit 3bdb207

Please sign in to comment.