Browse Source

Fix mouse position for iOS (fixes #668).

pull/675/merge
Matthew Petroff 6 years ago
parent
commit
d12baa08d4
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/js/pannellum.js

+ 3
- 2
src/js/pannellum.js View File

@@ -658,8 +658,9 @@ function aboutMessage(event) {
function mousePosition(event) {
var bounds = container.getBoundingClientRect();
var pos = {};
pos.x = event.clientX - bounds.left;
pos.y = event.clientY - bounds.top;
// pageX / pageY needed for iOS
pos.x = (event.clientX || event.pageX) - bounds.left;
pos.y = (event.clientY || event.pageY) - bounds.top;
return pos;
}



Loading…
Cancel
Save