mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Fix the clickable area for rotated ink annotations
This commit is contained in:
parent
d448953166
commit
1460a8128a
4 changed files with 70 additions and 23 deletions
|
@ -16,6 +16,7 @@
|
|||
import {
|
||||
closePages,
|
||||
getQuerySelector,
|
||||
getRect,
|
||||
getSelector,
|
||||
loadAndWait,
|
||||
} from "./test_utils.mjs";
|
||||
|
@ -654,4 +655,38 @@ describe("ResetForm action", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Rotated annotation and its clickable area", () => {
|
||||
describe("issue14438.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait(
|
||||
"rotated_ink.pdf",
|
||||
"[data-annotation-id='18R']"
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check that the clickable area has been rotated", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
const rect = await getRect(page, "[data-annotation-id='18R']");
|
||||
const promisePopup = page.waitForSelector(
|
||||
"[data-annotation-id='19R']",
|
||||
{ visible: true }
|
||||
);
|
||||
await page.mouse.move(
|
||||
rect.x + rect.width * 0.1,
|
||||
rect.y + rect.height * 0.9
|
||||
);
|
||||
await promisePopup;
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -684,3 +684,4 @@
|
|||
!issue19083.pdf
|
||||
!issue19120.pdf
|
||||
!bug1934157.pdf
|
||||
!rotated_ink.pdf
|
||||
|
|
BIN
test/pdfs/rotated_ink.pdf
Normal file
BIN
test/pdfs/rotated_ink.pdf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue