Skip to content

Commit

Permalink
fix(gesture): RTL fix for slide-gesture (#11822)
Browse files Browse the repository at this point in the history
RTL fix for slide-gesture
  • Loading branch information
sijav authored and brandyscarney committed Jun 5, 2017
1 parent e3c60c5 commit 59a1e3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gestures/slide-gesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ export class SlideGesture extends PanGesture {
let coord = <any>pointerCoord(ev);
let newPos = coord[this.direction];
let newTimestamp = Date.now();
let velocity = (newPos - slide.pos) / (newTimestamp - slide.timestamp);
let velocity = (this.plt.isRTL ? (slide.pos - newPos) : (newPos - slide.pos)) / (newTimestamp - slide.timestamp);

slide.pos = newPos;
slide.timestamp = newTimestamp;
slide.distance = clamp(
slide.min,
newPos - slide.pointerStartPos + slide.elementStartPos,
(this.plt.isRTL ? slide.pointerStartPos - newPos : newPos - slide.pointerStartPos) + slide.elementStartPos,
slide.max
);
slide.velocity = velocity;
slide.delta = newPos - slide.pointerStartPos;
slide.delta = (this.plt.isRTL ? slide.pointerStartPos - newPos : newPos - slide.pointerStartPos);
this.onSlide(slide, ev);
}

Expand Down

0 comments on commit 59a1e3d

Please sign in to comment.