Skip to content

Commit

Permalink
fix: iterate highlight.values() ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
neaumusic committed Jan 13, 2024
1 parent b5617a8 commit 64aa85e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chrome_extension/content_script/highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ function drawScrollMarkers(runNumber: number) {
scrollMarkersCanvasContext.clearRect(0, 0, width, height);
});

for (let highlightedNode of highlights) {
for (let range of highlights.values()) {
requestAnimationFrame(() => {
if (runNumber !== latestRunNumber) return;
const dpr = devicePixelRatio || 1;
const clientRect = highlightedNode.getBoundingClientRect();
const clientRect = range.getBoundingClientRect();
if (!clientRect.width || !clientRect.height) return;

// window height times percent of element position in document
Expand Down

0 comments on commit 64aa85e

Please sign in to comment.