Skip to content

Commit

Permalink
Fix ink and eraser tools affecting other pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Aug 23, 2023
1 parent c5553f7 commit 51733b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pdf/pdf-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,7 @@ class PDFView {
action.triggered = true;
}
else if (action.type === 'ink') {
let point = position.rects[0].slice(0, 2);
let point = originalPagePosition.rects[0].slice(0, 2);
point = addPointToPath(action.annotation.position.paths[0], point);
point = point.map(value => parseFloat(value.toFixed(3)));
action.annotation.position.paths[0] = point;
Expand All @@ -1858,7 +1858,7 @@ class PDFView {
}
}
annotations.push(...action.annotations.values());
let [x, y] = position.rects[0];
let [x, y] = originalPagePosition.rects[0];
let updatedAnnotations = eraseInk(x, y, this._tool.size, annotations);
for (let annotation of updatedAnnotations) {
action.annotations.set(annotation.id, annotation);
Expand Down

0 comments on commit 51733b3

Please sign in to comment.