Skip to content

Commit

Permalink
Fix highlight/underline resizing regression
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Dec 1, 2023
1 parent f3bca3e commit e86e7d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pdf/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export function extractRangeByRects({ structuredText, pageIndex, rects }) {

function getTopMostRectFromPosition(position) {
// Sort the rectangles based on their y2 value in descending order and return the first one
return position?.rects.sort((a, b) => b[2] - a[2])[0];
return position?.rects.slice().sort((a, b) => b[2] - a[2])[0];
}

export function getSortIndex(pdfPages, position) {
Expand Down

0 comments on commit e86e7d0

Please sign in to comment.