Skip to content
Permalink
Browse files

fix bug with drag speed

  • Loading branch information...
dzmitry-stramavus committed May 16, 2019
1 parent a197271 commit 1c688c3b5dc62ed96a6a59670f1bccaf16cd7d73
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/ci360.service.js
@@ -151,9 +151,6 @@ class CI360Viewer {
if (pageX - this.movementStart >= this.speedFactor) {
let itemsSkippedRight = Math.floor((pageX - this.movementStart) / this.speedFactor) || 1;

if (itemsSkippedRight >= 3 * this.speedFactor)
itemsSkippedRight = 3 * this.speedFactor;

this.movementStart = pageX;

if (this.spinReverse) {
@@ -167,9 +164,6 @@ class CI360Viewer {
} else if (this.movementStart - pageX >= this.speedFactor) {
let itemsSkippedLeft = Math.floor((this.movementStart - pageX) / this.speedFactor) || 1;

if (itemsSkippedLeft >= 3 * this.speedFactor)
itemsSkippedLeft = 3 * this.speedFactor;

this.movementStart = pageX;

if (this.spinReverse) {
@@ -269,6 +263,8 @@ class CI360Viewer {
this.speedFactor = Math.floor(this.dragSpeed / 150 * 36 / this.amount * 25 * imageOffsetWidth / 1500) || 1;
}

console.log(this.speedFactor);

if (this.autoplay) {
this.play();
}

0 comments on commit 1c688c3

Please sign in to comment.
You can’t perform that action at this time.