IngenieurStudioHollaus 6 anni fa
committed by GitHub
parent
commit
91a46da0e3
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 17 aggiunte e 7 eliminazioni
  1. +17
    -7
      src/js/pannellum.js

+ 17
- 7
src/js/pannellum.js Vedi File

@@ -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


Caricamento…
Annulla
Salva