Move info link for small structure boxes
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<canvas id="im-draw" ref="image_cvs" @click="structureClick" :style="`display: ${(imageLoaded || videoAvailable) ? 'block' : 'none'}; flex: 1 1 0%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; background-size: contain; background-position: center; background-repeat: no-repeat; z-index: 2;`" />
|
||||
<f7-link v-if="getInfoUrl && (selectedChip > -1)"
|
||||
:style="`left: ${infoLinkPos.x}px; top: ${infoLinkPos.y}px;`"
|
||||
:style="`left: ${infoLinkPos.x}px; top: ${infoLinkPos.y}px; transform: translate(calc(-50% - ${infoLinkPos.adj}px),calc(-50% - ${infoLinkPos.adj}px));`"
|
||||
class="structure-info"
|
||||
:icon-only="true"
|
||||
icon-f7="info"
|
||||
@@ -358,14 +358,17 @@
|
||||
}
|
||||
|
||||
const boxCoords = this.box2cvs(this.resultData.detections[iChip])[0]
|
||||
this.infoLinkPos.x = boxCoords.cvsLeft
|
||||
this.infoLinkPos.y = boxCoords.cvsTop
|
||||
|
||||
let boxLeft = boxCoords.cvsLeft
|
||||
let boxTop = boxCoords.cvsTop
|
||||
let boxWidth = boxCoords.cvsRight - boxCoords.cvsLeft
|
||||
var boxHeight = boxCoords.cvsBottom - boxCoords.cvsTop
|
||||
imageCtx.strokeRect(boxLeft,boxTop,boxWidth,boxHeight)
|
||||
let boxHeight = boxCoords.cvsBottom - boxCoords.cvsTop
|
||||
this.infoLinkPos.x = boxCoords.cvsLeft
|
||||
this.infoLinkPos.y = boxCoords.cvsTop
|
||||
let boxMin = Math.min(boxHeight, boxWidth)
|
||||
this.infoLinkPos.adj = (boxMin >= 50) ? 0 : Math.min(10, 50 - boxMin)
|
||||
|
||||
imageCtx.strokeRect(boxLeft, boxTop, boxWidth, boxHeight)
|
||||
this.selectedChip = iChip
|
||||
this.resultData.detections[iChip].beenViewed = true
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user