Quellcode durchsuchen

Added config option to adjust the drag speed by a factor

pull/556/head
Jonathan Bowman vor 6 Jahren
Ursprung
Commit
1960d99036
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. +2
    -1
      src/js/pannellum.js

+ 2
- 1
src/js/pannellum.js Datei anzeigen

@@ -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;


Laden…
Abbrechen
Speichern