feat:page header boundary value

pr675
Hufe921 3 years ago
parent 436d1de284
commit ed79d2587c

@ -73,8 +73,9 @@ export class Header {
} }
public getMaxHeight(): number { public getMaxHeight(): number {
const { header: { maxHeightRadio }, height } = this.options const { header: { maxHeightRadio } } = this.options
return height * maxHeightRadioMapping[maxHeightRadio] const height = this.draw.getOriginalHeight()
return Math.floor(height * maxHeightRadioMapping[maxHeightRadio])
} }
public getHeight(): number { public getHeight(): number {
@ -90,9 +91,9 @@ export class Header {
public getExtraHeight(): number { public getExtraHeight(): number {
const { header: { top: headerTop } } = this.options const { header: { top: headerTop } } = this.options
// 页眉上边距 + 实际高 - 页面上边距 // 页眉上边距 + 实际高 - 页面上边距
const rowHeight = this.getRowHeight()
const margins = this.draw.getOriginalMargins() const margins = this.draw.getOriginalMargins()
const extraHeight = headerTop + rowHeight - margins[0] const headerHeight = this.getHeight()
const extraHeight = headerTop + headerHeight - margins[0]
return extraHeight <= 0 ? 0 : extraHeight return extraHeight <= 0 ? 0 : extraHeight
} }

Loading…
Cancel
Save