瀏覽代碼

Fix (?) device orientation performance issue.

tags/2.3.1
Matthew Petroff 8 年之前
父節點
當前提交
a30261ca8c
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      src/js/pannellum.js

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

@@ -1258,7 +1258,7 @@ function animate() {
render();
if (autoRotateStart)
clearTimeout(autoRotateStart);
if (isUserInteracting) {
if (isUserInteracting || orientation) {
requestAnimationFrame(animate);
} else if (keysDown[0] || keysDown[1] || keysDown[2] || keysDown[3] ||
keysDown[4] || keysDown[5] || keysDown[6] || keysDown[7] ||
@@ -1455,7 +1455,6 @@ function orientationListener(e) {
config.pitch = q[0] / Math.PI * 180;
config.roll = -q[1] / Math.PI * 180;
config.yaw = -q[2] / Math.PI * 180 + config.northOffset;
animate();
}

/**
@@ -2101,6 +2100,7 @@ function startOrientation() {
orientation = true;
window.addEventListener('deviceorientation', orientationListener);
controls.orientation.classList.add('pnlm-orientation-button-active');
requestAnimationFrame(animate);
}

/**


Loading…
取消
儲存