diff --git a/src/gestures/slide-gesture.ts b/src/gestures/slide-gesture.ts index 79399a92c91..c49701aa788 100644 --- a/src/gestures/slide-gesture.ts +++ b/src/gestures/slide-gesture.ts @@ -66,17 +66,17 @@ export class SlideGesture extends PanGesture { let coord = 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); }