Skip to content

Commit 57d3e7b

Browse files
committed
fix: highlighter more accurate area size
1 parent 1467a5e commit 57d3e7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/app-backend-core/src/highlighter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ export async function unHighlight () {
7979
function showOverlay ({ width = 0, height = 0, top = 0, left = 0 }, children: Node[] = []) {
8080
if (!isBrowser || !children.length) return
8181

82-
overlay.style.width = ~~width + 'px'
83-
overlay.style.height = ~~height + 'px'
84-
overlay.style.left = ~~left + 'px'
85-
overlay.style.top = ~~top + 'px'
82+
overlay.style.width = Math.round(width) + 'px'
83+
overlay.style.height = Math.round(height) + 'px'
84+
overlay.style.left = Math.round(left) + 'px'
85+
overlay.style.top = Math.round(top) + 'px'
8686
document.body.appendChild(overlay)
8787

8888
overlayContent.innerHTML = ''

0 commit comments

Comments
 (0)