Skip to content

Commit 5f8b8ca

Browse files
authored
parseFloat
1 parent 9ecb658 commit 5f8b8ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@
122122
});
123123
} else { // if you set body `position` as `relative`, `absolute`, things can get complicated
124124
const bodyRect = document.body.getBoundingClientRect();
125-
const bodyBorderLeft = parseInt(bodyStyle.borderLeftWidth);
126-
const bodyBorderBottom = parseInt(bodyStyle.borderBottomWidth);
127-
const bodyPaddingLeft = parseInt(bodyStyle.paddingLeft);
128-
const bodyPaddingBottom = parseInt(bodyStyle.paddingBottom);
125+
const bodyBorderLeft = parseFloat(bodyStyle.borderLeftWidth);
126+
const bodyBorderBottom = parseFloat(bodyStyle.borderBottomWidth);
127+
const bodyPaddingLeft = parseFloat(bodyStyle.paddingLeft);
128+
const bodyPaddingBottom = parseFloat(bodyStyle.paddingBottom);
129129
Object.assign(divInf.style, {
130130
left: `calc(${(convertedP1.x + convertedP2.x) / 2 - bodyRect.left - bodyBorderLeft - bodyPaddingLeft}px - ${divInfWidth} / 2)`,
131131
bottom: `${bodyRect.bottom - convertedP1.y - bodyBorderBottom - bodyPaddingBottom + divInfVerticalOffset}px`,

0 commit comments

Comments
 (0)