Skip to content

Commit 276c8f3

Browse files
committed
[Editor] Take into account the parent rotation when switch to edit mode (issue #19424)
1 parent 1a39e2d commit 276c8f3

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

src/display/editor/highlight.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ class HighlightEditor extends AnnotationEditor {
984984
clipPathId,
985985
});
986986
editor.#addToDrawLayer();
987+
editor.rotate(editor.parentRotation);
987988
}
988989

989990
return editor;

test/integration/highlight_editor_spec.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,4 +2674,34 @@ describe("Highlight Editor", () => {
26742674
);
26752675
});
26762676
});
2677+
2678+
describe("Highlight must be rotated when existing in the pdf", () => {
2679+
let pages;
2680+
2681+
beforeAll(async () => {
2682+
pages = await loadAndWait("issue19424.pdf", ".annotationEditorLayer");
2683+
});
2684+
2685+
afterAll(async () => {
2686+
await closePages(pages);
2687+
});
2688+
2689+
it("must check that there is no scroll because of focus", async () => {
2690+
await Promise.all(
2691+
pages.map(async ([browserName, page]) => {
2692+
await page.evaluate(() => {
2693+
window.PDFViewerApplication.rotatePages(90);
2694+
});
2695+
await page.waitForSelector(
2696+
".annotationEditorLayer[data-main-rotation='90']"
2697+
);
2698+
await switchToHighlight(page);
2699+
2700+
await page.waitForSelector(
2701+
".canvasWrapper svg[data-main-rotation='90']"
2702+
);
2703+
})
2704+
);
2705+
});
2706+
});
26772707
});

test/pdfs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,3 +713,4 @@
713713
!colors.pdf
714714
!red_stamp.pdf
715715
!issue19633.pdf
716+
!issue19424.pdf

test/pdfs/issue19424.pdf

8.88 KB
Binary file not shown.

0 commit comments

Comments
 (0)