# HG changeset patch # User Bernhard Reiter # Date 1562165657 -7200 # Node ID 6081743c0d98c8020370958bdc01238b392f64a5 # Parent c66cdde873b55538b232b96fd62276f073dca90d# Parent 60977e18e2279766cb03f5ba210c2acde12232fd client: merge diff -r c66cdde873b5 -r 6081743c0d98 client/src/components/Pdftool.vue --- a/client/src/components/Pdftool.vue Wed Jul 03 16:50:28 2019 +0200 +++ b/client/src/components/Pdftool.vue Wed Jul 03 16:54:17 2019 +0200 @@ -829,13 +829,6 @@ textOptions ); } - }, - getTextHeight(numberOfLines) { - return ( - numberOfLines * - ((this.pdf.doc.getFontSize() * 25.4) / parseInt(this.form.resolution)) * - 1.15 // see https://github.com/yWorks/jsPDF/blob/master/jspdf.js#L207 - ); } }, mounted() { diff -r c66cdde873b5 -r 6081743c0d98 client/src/lib/mixins.js --- a/client/src/lib/mixins.js Wed Jul 03 16:50:28 2019 +0200 +++ b/client/src/lib/mixins.js Wed Jul 03 16:54:17 2019 +0200 @@ -153,7 +153,16 @@ this.addRoundedBox(x, y, width, height, color, rounding, brcolor); }, getTextHeight(numberOfLines) { - return numberOfLines * ((this.pdf.doc.getFontSize() * 25.4) / 80) * 1.15; // see https://github.com/yWorks/jsPDF/blob/master/jspdf.js#L207 + // Return estimated height in mm. + + // FontSize is given in desktop publishing points defined as 1/72 inch. + // aka 25.4 / 72 mm + let fontSize = this.pdf.doc.getFontSize(); + let lineHeightFactor = 1.15; // default from jspdf-yworks 2.0.2 + if (typeof this.pdf.doc.getLineHeightFactor !== "undefined") { + lineHeightFactor = this.pdf.doc.getLineHeightFactor(); + } + return numberOfLines * fontSize * (25.4 / 72) * lineHeightFactor; }, // title for diagram addDiagramTitle(position, offset, size, color, text) {