Fix structure click selection error
All checks were successful
Build Dev PWA / Build-PWA (push) Successful in 37s

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-10-12 20:22:41 -07:00
parent 8bf74e51ea
commit 1936d90550

View File

@@ -613,9 +613,9 @@
}
let boxCoords = []
this.resultData.detections.forEach(d => {
if (d.aboveThreshold && d.isSearched && !d.isDeleted) {
boxCoords.push(d.box.getBoxes('point',this.imageView,this.$refs.image_cvs)[1])
}
let cvsBox = d.box.getBoxes('point',this.imageView,this.$refs.image_cvs)[1]
cvsBox.clickable = d.aboveThreshold && d.isSearched && !d.isDeleted
boxCoords.push(cvsBox)
})
const numBoxes = boxCoords.length
let clickX = (e.offsetX - this.canvasOffset.x) / this.canvasZoom
@@ -625,7 +625,8 @@
const findBox = boxCoords.findIndex( (r, i) => {
let di = loopIndex(i)
if (di == this.selectedChip ) return false
return r.left <= clickX &&
return r.clickable &&
r.left <= clickX &&
r.right >= clickX &&
r.top <= clickY &&
r.bottom >= clickY