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 #13665 from calixteman/reserve

XFA - Fix indentation for justified paragraph
This commit is contained in:
calixteman 2021-07-05 15:45:59 +02:00 committed by GitHub
commit b9e84ba70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View file

@ -529,12 +529,10 @@ function fixTextIndent(styles) {
}
// If indent is negative then it's a hanging indent.
const align = styles.textAlign || "left";
if (align === "left" || align === "right") {
const name = "padding" + (align === "left" ? "Left" : "Right");
const padding = getMeasurement(styles[name], "0px");
styles[name] = `${padding - indent}px`;
}
const align = styles.textAlign === "right" ? "right" : "left";
const name = "padding" + (align === "left" ? "Left" : "Right");
const padding = getMeasurement(styles[name], "0px");
styles[name] = `${padding - indent}px`;
}
function setAccess(node, classNames) {

View file

@ -897,7 +897,7 @@ class Caption extends XFAObject {
"inactive",
"invisible",
]);
this.reserve = getMeasurement(attributes.reserve);
this.reserve = Math.ceil(getMeasurement(attributes.reserve));
this.use = attributes.use || "";
this.usehref = attributes.usehref || "";
this.extras = null;