diff --git a/src/pages/detect.vue b/src/pages/detect.vue index 15fe219..95de219 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -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