Skip to content

Commit

Permalink
feat:page header boundary value
Browse files Browse the repository at this point in the history
  • Loading branch information
Hufe921 committed Mar 18, 2023
1 parent 436d1de commit ed79d25
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/editor/core/draw/frame/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ export class Header {
}

public getMaxHeight(): number {
const { header: { maxHeightRadio }, height } = this.options
return height * maxHeightRadioMapping[maxHeightRadio]
const { header: { maxHeightRadio } } = this.options
const height = this.draw.getOriginalHeight()
return Math.floor(height * maxHeightRadioMapping[maxHeightRadio])
}

public getHeight(): number {
Expand All @@ -90,9 +91,9 @@ export class Header {
public getExtraHeight(): number {
const { header: { top: headerTop } } = this.options
// 页眉上边距 + 实际高 - 页面上边距
const rowHeight = this.getRowHeight()
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
}

Expand Down

0 comments on commit ed79d25

Please sign in to comment.