diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index df9ad32..ca2b14d 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -735,16 +735,10 @@ rect = this.interactionDOMElement.getBoundingClientRect(); } - if (navigator.isCocoonJS) - { - point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * this.resolution; - point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * this.resolution; - } - else - { - point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) / this.resolution; - point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) / this.resolution; - } + const resolutionMultiplier = navigator.isCocoonJS ? this.resolution : (1.0 / this.resolution); + + point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * resolutionMultiplier; + point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * resolutionMultiplier; } /**