Skip to content
This repository has been archived by the owner on Jul 29, 2020. It is now read-only.

Commit

Permalink
fix directionX,Y when scrolling with mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
sculove authored and aisouard committed Feb 21, 2017
1 parent d1ad849 commit b80feaa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wheel/wheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@
newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);
newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);

this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;
this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;

if ( newX > 0 ) {
newX = 0;
} else if ( newX < this.maxScrollX ) {
Expand Down

0 comments on commit b80feaa

Please sign in to comment.