Fix hotspot moving regression

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-11-04 18:34:09 -07:00
parent 9bd6f172c2
commit a3b6aa1418

View File

@@ -301,9 +301,6 @@ grabAnnotation = function(e) {
const contEl = $('.glmv-container')[0]
contEl.addEventListener('mousemove', moveAnnotation)
const mvEl = $('model-viewer')[0]
console.log(contEl)
console.log(e)
console.log(mvEl.queryHotspot(e.target.slot))
} else {
grabHotspot = null
}
@@ -328,7 +325,6 @@ moveAnnotation = function(e) {
*/
releaseAnnotation = function(e) {
if (grabHotspot && grabHotspot.move) {
console.log(e.target)
e.target.style['transform']=''
const contEl = $('.glmv-container')[0]
contEl.removeEventListener('mousemove', moveAnnotation)
@@ -348,7 +344,7 @@ releaseAnnotation = function(e) {
const newTarg = `${targetObj.x.toFixed(5)}m ${targetObj.y.toFixed(5)}m ${targetObj.z.toFixed(5)}m`
e.target.setAttribute('data-target', newTarg)
let currentText = $('#wpTextbox1').val()
let metadata = extractMetadata(currentText)
let [_, metadata] = extractMetadata(currentText)
metadata.annotations[e.target.childNodes[0].innerText] = {
"data-position": newPos,
"data-normal": newNorm,