1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 15:47:57 +02:00

Support rotating editor layer

- As in the annotation layer, use percent instead of pixels as unit;
- handle the rotation of the editor layer in allowing editing when rotation
  angle is not zero;
- the different editors are rotated counterclockwise in order to be usable
  when the main page is itself rotated;
- add support for saving/printing rotated editors.
This commit is contained in:
Calixte Denizet 2022-06-23 15:47:45 +02:00
parent b5fea8ff14
commit 0c420f5135
13 changed files with 473 additions and 159 deletions

View file

@ -1413,7 +1413,7 @@ describe("Interaction", () => {
await closePages(pages);
});
it("must check that data-annotation-rotation is correct", async () => {
it("must check that data-main-rotation is correct", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.waitForFunction(
@ -1431,7 +1431,7 @@ describe("Interaction", () => {
]) {
const rotation = await page.$eval(
`[data-annotation-id='${ref}R']`,
el => parseInt(el.getAttribute("data-annotation-rotation") || 0)
el => parseInt(el.getAttribute("data-main-rotation") || 0)
);
expect(rotation)
.withContext(`In ${browserName}`)