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:
commit
52ef63f1fe
3 changed files with 18 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue