XFA - Add margins if needed after having layout some text
This commit is contained in:
parent
eb755d098e
commit
aca102a35e
@ -1457,6 +1457,13 @@ class Draw extends XFAObject {
|
||||
fixDimensions(this);
|
||||
|
||||
if ((this.w === "" || this.h === "") && this.value) {
|
||||
let marginH = 0;
|
||||
let marginV = 0;
|
||||
if (this.margin) {
|
||||
marginH = this.margin.leftInset + this.margin.rightInset;
|
||||
marginV = this.margin.topInset + this.margin.bottomInset;
|
||||
}
|
||||
|
||||
const maxWidth = this.w === "" ? availableSpace.width : this.w;
|
||||
const fontFinder = this[$globalData].fontFinder;
|
||||
let font = this.font;
|
||||
@ -1496,11 +1503,11 @@ class Draw extends XFAObject {
|
||||
}
|
||||
|
||||
if (width !== null && this.w === "") {
|
||||
this.w = width;
|
||||
this.w = width + marginH;
|
||||
}
|
||||
|
||||
if (height !== null && this.h === "") {
|
||||
this.h = height;
|
||||
this.h = height + marginV;
|
||||
}
|
||||
}
|
||||
|
||||
|
1
test/pdfs/xfa_bug1716380.pdf.link
Normal file
1
test/pdfs/xfa_bug1716380.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
https://bugzilla.mozilla.org/attachment.cgi?id=9227435
|
@ -930,6 +930,14 @@
|
||||
"link": true,
|
||||
"type": "load"
|
||||
},
|
||||
{ "id": "xfa_bug1716380",
|
||||
"file": "pdfs/xfa_bug1716380.pdf",
|
||||
"md5": "1351f816f0509fe750ca61ef2bd40872",
|
||||
"link": true,
|
||||
"rounds": 1,
|
||||
"enableXfa": true,
|
||||
"type": "eq"
|
||||
},
|
||||
{ "id": "xfa_bug1716047",
|
||||
"file": "pdfs/xfa_bug1716047.pdf",
|
||||
"md5": "2f524163bd8397f43d195090978c3b56",
|
||||
|
Loading…
Reference in New Issue
Block a user