From 1936d90550e2c49a59358f114b98282d7d21304e Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Sat, 12 Oct 2024 20:22:41 -0700 Subject: [PATCH] Fix structure click selection error Signed-off-by: Justin Georgi --- src/pages/detect.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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