Skip to content

Commit

Permalink
stephanrauh/ngx-extended-pdf-viewer#1825 stop moving imported annotat…
Browse files Browse the repository at this point in the history
…ions to new coordinates
  • Loading branch information
stephanrauh committed Aug 20, 2023
1 parent f74a9b9 commit 2bc58ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
5 changes: 5 additions & 0 deletions src/display/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ class AnnotationEditor {
setAt(x, y, tx, ty) {
const [width, height] = this.parentDimensions;
[tx, ty] = this.screenToPageTranslation(tx, ty);
// #1825 modified by ngx-extended-pdf-viewer
if (this.doNotMove) {
[tx, ty] = [0, 0];
}
// #1825 end of modification

this.x = (x + tx) / width;
this.y = (y + ty) / height;
Expand Down
22 changes: 7 additions & 15 deletions src/display/editor/ink.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,21 +802,13 @@ class InkEditor extends AnnotationEditor {
// This editor was created in using copy (ctrl+c).
const [parentWidth, parentHeight] = this.parentDimensions;
this.setAspectRatio(this.width * parentWidth, this.height * parentHeight);
if (this.doNotMove) {
this.setAt(
baseX * parentWidth,
baseY * parentHeight,
0,
0
);
} else {
this.setAt(
baseX * parentWidth,
baseY * parentHeight,
this.width * parentWidth,
this.height * parentHeight
);
}
this.setAt(
baseX * parentWidth,
baseY * parentHeight,
this.width * parentWidth,
this.height * parentHeight
);

this.#isCanvasInitialized = true;
this.#setCanvasDims();
this.setDims(this.width * parentWidth, this.height * parentHeight);
Expand Down
2 changes: 1 addition & 1 deletion web/ngx-extended-pdf-viewer-version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ngxExtendedPdfViewerVersion = '18.0.0-beta.2';
export const ngxExtendedPdfViewerVersion = '18.0.0-beta.3';

0 comments on commit 2bc58ab

Please sign in to comment.