Browse Source

Fix issue with mouse dragging causing jump around yaw limits (fixes #698)

pull/707/head
Matthew Petroff 6 years ago
parent
commit
12516e69b9
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/js/pannellum.js

+ 6
- 6
src/js/pannellum.js View File

@@ -1399,12 +1399,6 @@ function render() {
var tmpyaw;

if (loaded) {
if (config.yaw > 180) {
config.yaw -= 360;
} else if (config.yaw < -180) {
config.yaw += 360;
}

// Keep a tmp value of yaw for autoRotate comparison later
tmpyaw = config.yaw;

@@ -1439,6 +1433,12 @@ function render() {
config.yaw = Math.max(minYaw, Math.min(maxYaw, config.yaw));
}
if (config.yaw > 180) {
config.yaw -= 360;
} else if (config.yaw < -180) {
config.yaw += 360;
}

// Check if we autoRotate in a limited by min and max yaw
// If so reverse direction
if (config.autoRotate !== false && tmpyaw != config.yaw &&


Loading…
Cancel
Save