From 383818b6f8d3373b9175882e4275361bffbf3d8e Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Sat, 3 May 2025 07:59:39 -0700 Subject: [PATCH] Fix: annotation drag Signed-off-by: Justin Georgi --- modules/glmv-hs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/glmv-hs.js b/modules/glmv-hs.js index 4eee269..95c769e 100644 --- a/modules/glmv-hs.js +++ b/modules/glmv-hs.js @@ -93,7 +93,7 @@ isDeleting = function() { */ grabAnnotation = function(e) { if (e.ctrlKey) { - grabHotspot = {x: e.x, y: e.y} + grabHotspot = {x: e.x, y: e.y, target: e.target} const contEl = $('.glmv-container')[0] contEl.addEventListener('mousemove', moveAnnotation) const mvEl = $('model-viewer')[0] @@ -110,7 +110,7 @@ grabAnnotation = function(e) { moveAnnotation = function(e) { if (grabHotspot) { grabHotspot.move = true - e.target.style['transform'] = `translate(${e.x - grabHotspot.x}px, ${e.y - grabHotspot.y}px) scale(1.1,1.1)` + grabHotspot.target.style['transform'] = `translate(${e.x - grabHotspot.x}px, ${e.y - grabHotspot.y}px) scale(1.1,1.1)` } }