Skip to content

Commit

Permalink
fix(ImageDetection): stop tooltip overflow with fudge to center
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Oct 7, 2024
1 parent 5676a1f commit 0346cfc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vue-components/src/components/ImageDetection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CATEGORY_COLORS: Vector3<number>[] = [
]
const TOOLTIP_OFFSET = [8, 8]
const TOOLTIP_HEIGHT_PADDING = 12 // fudge to keep bottom border from clipping. In pixels
const TOOLTIP_PADDING = 12 // fudge to keep tooltip from clipping/overflowing. In pixels
let annotationsTree: Quadtree<Rectangle<number>> | undefined = undefined
Expand Down Expand Up @@ -220,8 +220,8 @@ function mouseMove(e: MouseEvent) {
const toolTipInContainer = {
left: parentRect.left + posX - containerRect.left,
top: parentRect.top + posY - containerRect.top,
width: tooltipRect.width,
height: tooltipRect.height + TOOLTIP_HEIGHT_PADDING
width: tooltipRect.width + TOOLTIP_PADDING,
height: tooltipRect.height + TOOLTIP_PADDING
}
// if text goes off the edge, move up and/or left
Expand Down

0 comments on commit 0346cfc

Please sign in to comment.