Skip to content

Commit

Permalink
Fix ink eraser affecting all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Nov 14, 2024
1 parent 3639b1c commit 4643dcc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pdf/pdf-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,10 @@ class PDFView {
else if (action.type === 'erase') {
let annotations = [];
for (let annotation of this._annotations) {
if (annotation.type === 'ink' && !action.annotations.has(annotation.id)) {
if (annotation.type === 'ink'
&& annotation.position.pageIndex === position.pageIndex
&& !action.annotations.has(annotation.id)
) {
annotations.push(annotation);
}
}
Expand Down Expand Up @@ -2224,7 +2227,9 @@ class PDFView {
else if (action.type === 'erase') {
let annotations = [];
for (let annotation of this._annotations) {
if (annotation.type === 'ink' && !action.annotations.has(annotation.id)) {
if (annotation.type === 'ink'
&& annotation.position.pageIndex === position.pageIndex
&& !action.annotations.has(annotation.id)) {
annotations.push(annotation);
}
}
Expand Down

0 comments on commit 4643dcc

Please sign in to comment.