瀏覽代碼

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

pull/707/head
Matthew Petroff 6 年之前
父節點
當前提交
12516e69b9
共有 1 個檔案被更改,包括 6 行新增6 行删除
  1. +6
    -6
      src/js/pannellum.js

+ 6
- 6
src/js/pannellum.js 查看文件

@@ -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…
取消
儲存