From 1960d99036ab4b0f29ceb17c8946697322262911 Mon Sep 17 00:00:00 2001 From: Jonathan Bowman Date: Mon, 26 Feb 2018 17:05:02 -0500 Subject: [PATCH] Added config option to adjust the drag speed by a factor --- src/js/pannellum.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 09f12bf..ad7f1de 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -103,6 +103,7 @@ var defaultConfig = { draggable: true, disableKeyboardCtrl: false, crossOrigin: 'anonymous', + touchmovePanSpeedCoeffFactor: 1 }; // Translatable / configurable strings @@ -871,7 +872,7 @@ function onDocumentTouchMove(event) { // // Currently this seems to *roughly* keep initial drag/pan start position close to // the user's finger while panning regardless of zoom level / config.hfov value. - var touchmovePanSpeedCoeff = config.hfov / 360; + var touchmovePanSpeedCoeff = (config.hfov / 360) * config.touchmovePanSpeedCoeffFactor; var yaw = (onPointerDownPointerX - clientX) * touchmovePanSpeedCoeff + onPointerDownYaw; speed.yaw = (yaw - config.yaw) % 360 * 0.2;