Skip to content

Commit 3f4c963

Browse files
committed
Use Rect.translate to create rects for addFlashRect
1 parent e8d0fe5 commit 3f4c963

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

content_scripts/link_hints.coffee

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,8 @@ class LinkHintsMode
388388
installKeyboardBlocker = (startKeyboardBlocker) ->
389389
if linkMatched.isLocalMarker
390390
{top: viewportTop, left: viewportLeft} = DomUtils.getViewportTopLeft()
391-
for rect in (Rect.copy rect for rect in clickEl.getClientRects())
392-
extend rect, top: rect.top + viewportTop, left: rect.left + viewportLeft
393-
flashEl = DomUtils.addFlashRect rect
391+
for rect in clickEl.getClientRects()
392+
flashEl = DomUtils.addFlashRect Rect.translate rect, viewportLeft, viewportTop
394393
do (flashEl) -> HintCoordinator.onExit.push -> DomUtils.removeElement flashEl
395394

396395
if windowIsFocused()

0 commit comments

Comments
 (0)