Fix hotspot moving regression
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -301,9 +301,6 @@ grabAnnotation = function(e) {
|
|||||||
const contEl = $('.glmv-container')[0]
|
const contEl = $('.glmv-container')[0]
|
||||||
contEl.addEventListener('mousemove', moveAnnotation)
|
contEl.addEventListener('mousemove', moveAnnotation)
|
||||||
const mvEl = $('model-viewer')[0]
|
const mvEl = $('model-viewer')[0]
|
||||||
console.log(contEl)
|
|
||||||
console.log(e)
|
|
||||||
console.log(mvEl.queryHotspot(e.target.slot))
|
|
||||||
} else {
|
} else {
|
||||||
grabHotspot = null
|
grabHotspot = null
|
||||||
}
|
}
|
||||||
@@ -328,7 +325,6 @@ moveAnnotation = function(e) {
|
|||||||
*/
|
*/
|
||||||
releaseAnnotation = function(e) {
|
releaseAnnotation = function(e) {
|
||||||
if (grabHotspot && grabHotspot.move) {
|
if (grabHotspot && grabHotspot.move) {
|
||||||
console.log(e.target)
|
|
||||||
e.target.style['transform']=''
|
e.target.style['transform']=''
|
||||||
const contEl = $('.glmv-container')[0]
|
const contEl = $('.glmv-container')[0]
|
||||||
contEl.removeEventListener('mousemove', moveAnnotation)
|
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`
|
const newTarg = `${targetObj.x.toFixed(5)}m ${targetObj.y.toFixed(5)}m ${targetObj.z.toFixed(5)}m`
|
||||||
e.target.setAttribute('data-target', newTarg)
|
e.target.setAttribute('data-target', newTarg)
|
||||||
let currentText = $('#wpTextbox1').val()
|
let currentText = $('#wpTextbox1').val()
|
||||||
let metadata = extractMetadata(currentText)
|
let [_, metadata] = extractMetadata(currentText)
|
||||||
metadata.annotations[e.target.childNodes[0].innerText] = {
|
metadata.annotations[e.target.childNodes[0].innerText] = {
|
||||||
"data-position": newPos,
|
"data-position": newPos,
|
||||||
"data-normal": newNorm,
|
"data-normal": newNorm,
|
||||||
|
|||||||
Reference in New Issue
Block a user