mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
XFA - Add margins if needed after having layout some text
This commit is contained in:
parent
eb755d098e
commit
aca102a35e
3 changed files with 18 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue