Webapp: Fix screen-pos calculation on click

This commit is contained in:
Lukas Rieger (Blue) 2024-01-25 15:28:33 +01:00
parent 61f883b134
commit b3c4f3737d
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
1 changed files with 2 additions and 2 deletions

View File

@ -179,8 +179,8 @@ export class MapViewer {
handleMapInteraction(screenPosition, data = {}) {
let rootOffset = elementOffset(this.rootElement);
let normalizedScreenPos = new Vector2(
((screenPosition.x - rootOffset.top) / this.rootElement.clientWidth) * 2 - 1,
-((screenPosition.y - rootOffset.left) / this.rootElement.clientHeight) * 2 + 1
((screenPosition.x - rootOffset.left) / this.rootElement.clientWidth) * 2 - 1,
-((screenPosition.y - rootOffset.top) / this.rootElement.clientHeight) * 2 + 1
);
if (this.map && this.map.isLoaded){