mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
XFA - Fix auto-sized fields (bug 1722030)
- In order to better compute text fields size, use line height with no gaps (and consequently guessed height for text are slightly better in general). - Fix default background color in fields.
This commit is contained in:
parent
336a74a0e5
commit
76d882b560
14 changed files with 311 additions and 162 deletions
|
@ -247,7 +247,7 @@ function layoutNode(node, availableSpace) {
|
|||
}
|
||||
}
|
||||
|
||||
const maxWidth = !node.w ? availableSpace.width : node.w;
|
||||
const maxWidth = (!node.w ? availableSpace.width : node.w) - marginH;
|
||||
const fontFinder = node[$globalData].fontFinder;
|
||||
if (
|
||||
node.value.exData &&
|
||||
|
@ -614,10 +614,8 @@ function setFontFamily(xfaFont, fontFinder, style) {
|
|||
}
|
||||
|
||||
const pdfFont = selectFont(xfaFont, typeface);
|
||||
if (pdfFont && pdfFont.lineHeight > 0) {
|
||||
if (pdfFont) {
|
||||
style.lineHeight = Math.max(1.2, pdfFont.lineHeight);
|
||||
} else {
|
||||
style.lineHeight = 1.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue