Skip to content

Commit c40e174

Browse files
Change to line height factor getter function
1 parent 23a253b commit c40e174

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/documentHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,13 @@ export class DocHandler {
176176
return this.jsPDFDocument.internal.scaleFactor
177177
}
178178

179-
get lineHeightFactor(): number {
179+
getLineHeightFactor(): number {
180180
const doc = this.jsPDFDocument
181181
return doc.getLineHeightFactor ? doc.getLineHeightFactor() : 1.15
182182
}
183183

184184
getLineHeight(fontSize: number): number {
185-
return (fontSize / this.scaleFactor()) * this.lineHeightFactor
185+
return (fontSize / this.scaleFactor()) * this.getLineHeightFactor()
186186
}
187187

188188
pageNumber(): number {

src/tableDrawer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function modifyRowToFit(
196196
}
197197

198198
const scaleFactor = doc.scaleFactor()
199-
const lineHeightFactor = doc.lineHeightFactor
199+
const lineHeightFactor = doc.getLineHeightFactor()
200200
cell.contentHeight = cell.getContentHeight(scaleFactor, lineHeightFactor)
201201

202202
if (cell.contentHeight >= remainingPageSpace) {

src/widthCalculator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function fitContent(table: Table, doc: DocHandler) {
313313

314314
cell.contentHeight = cell.getContentHeight(
315315
doc.scaleFactor(),
316-
doc.lineHeightFactor,
316+
doc.getLineHeightFactor(),
317317
)
318318

319319
let realContentHeight = cell.contentHeight / cell.rowSpan

0 commit comments

Comments
 (0)