Skip to content

Commit

Permalink
Fix ink annotation drawing regression
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Dec 9, 2023
1 parent 9d8ba06 commit e99aebf
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.slice().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 e99aebf

Please sign in to comment.