Skip to content

Commit 69fa712

Browse files
authored
Update 3.show-result-texts-on-the-video.html
1 parent d3cb9a1 commit 69fa712

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

4.use-case/3.show-result-texts-on-the-video.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
word-break: break-all;
2626
word-wrap: break-word;
2727
box-shadow: 5px 5px 5px 3px rgba(0,0,0,0.2);
28-
transform: translate(-50%, -4px);
28+
transform: translate(-50%, calc(-100% - 4px));
2929
}
3030
.bubble-box::after{
3131
content: '';
@@ -116,15 +116,15 @@
116116
if (bodyStyle.position === "static") {
117117
Object.assign(divInf.style, {
118118
left: `${(convertedP1.x + convertedP2.x) / 2}px`,
119-
bottom: `${document.documentElement.clientHeight - convertedP1.y}px`,
119+
top: `${convertedP1.y}px`,
120120
});
121121
} else { // if you set body `position` as `relative`, `absolute`, things can get complicated
122122
const bodyRect = document.body.getBoundingClientRect();
123123
const bodyBorderLeft = parseFloat(bodyStyle.borderLeftWidth);
124124
const bodyBorderBottom = parseFloat(bodyStyle.borderBottomWidth);
125125
Object.assign(divInf.style, {
126126
left: `${(convertedP1.x + convertedP2.x) / 2 - bodyRect.left - bodyBorderLeft}px`,
127-
bottom: `${bodyRect.bottom - convertedP1.y - bodyBorderBottom}px`,
127+
top: `${convertedP1.y - bodyRect.top - bodyBorderBottom}px`,
128128
});
129129
}
130130
divInf.innerText = result.barcodeText;

0 commit comments

Comments
 (0)