浏览代码

Merge 4722cf4f50 into 3151cafb1c

pull/668/merge
IngenieurStudioHollaus 6 年前
committed by GitHub
父节点
当前提交
91a46da0e3
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 17 次插入7 次删除
  1. +17
    -7
      src/js/pannellum.js

+ 17
- 7
src/js/pannellum.js 查看文件

@@ -655,13 +655,23 @@ function aboutMessage(event) {
* @param {MouseEvent} event - Mouse event to use in calculation
* @returns {Object} Calculated X and Y coordinates
*/
function mousePosition(event) {
var bounds = container.getBoundingClientRect();
var pos = {};
pos.x = event.clientX - bounds.left;
pos.y = event.clientY - bounds.top;
return pos;
}
function mousePosition(event) {
var bounds = container.getBoundingClientRect();
var pos = {};

// #ISH Change
// "event.clientX" does not exist on iPhone/iPad (therefore positioning in viewer does not work), on iPhone mouse position is "event.pageX"
if (event.pageX) {
pos.x = event.pageX - bounds.left;
pos.y = event.pageY - bounds.top;
}
else {
pos.x = event.clientX - bounds.left;
pos.y = event.clientY - bounds.top;
}

return pos;
}

/**
* Event handler for mouse clicks. Initializes panning. Prints center and click


正在加载...
取消
保存