1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #13856 from calixteman/xfa_layout_rounding

XFA - Avoid to put something in very small areas
This commit is contained in:
calixteman 2021-08-04 10:09:13 +02:00 committed by GitHub
commit 52ef63f1fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View file

@ -290,13 +290,13 @@ function checkDimensions(node, space) {
return true;
}
if (parent[$extra].numberInLine === 0) {
return space.height > 0;
return space.height > ERROR;
}
return false;
}
return space.width > 0;
return space.width > ERROR;
}
// No layout failure.
@ -307,7 +307,7 @@ function checkDimensions(node, space) {
return Math.round(w - space.width) <= ERROR;
}
return space.width > 0;
return space.width > ERROR;
}
// Second attempt: try to put the element on the next line.
@ -322,14 +322,14 @@ function checkDimensions(node, space) {
}
if (node.w === "" || Math.round(w - space.width) <= ERROR) {
return space.height > 0;
return space.height > ERROR;
}
if (parent[$isThereMoreWidth]()) {
return false;
}
return space.height > 0;
return space.height > ERROR;
case "table":
case "tb":
if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
@ -345,14 +345,14 @@ function checkDimensions(node, space) {
// in the provided space and maybe a children won't fit.
if (node.w === "" || Math.round(w - space.width) <= ERROR) {
return space.height > 0;
return space.height > ERROR;
}
if (parent[$isThereMoreWidth]()) {
return false;
}
return space.height > 0;
return space.height > ERROR;
case "position":
if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {
return true;