mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Fix new intermittent failures with ink and stamp tests
It happens only on windows with chrome. For any reason, click event isn't correctly triggered and it seems work correctly with pointerup. And it seems that when drawing a svg on an OffscreenCanvas we need to wait a little in order to be able to transfer it: it's why this patch adds a check on the canvas content.
This commit is contained in:
parent
3ca63c68ea
commit
077d239b96
3 changed files with 39 additions and 9 deletions
|
@ -207,7 +207,18 @@ function getEditorDimensions(page, id) {
|
|||
}
|
||||
exports.getEditorDimensions = getEditorDimensions;
|
||||
|
||||
function serializeBitmapDimensions(page) {
|
||||
async function serializeBitmapDimensions(page) {
|
||||
await page.waitForFunction(() => {
|
||||
try {
|
||||
const map =
|
||||
window.PDFViewerApplication.pdfDocument.annotationStorage.serializable
|
||||
.map;
|
||||
return !!map;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return page.evaluate(() => {
|
||||
const { map } =
|
||||
window.PDFViewerApplication.pdfDocument.annotationStorage.serializable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue