summaryrefslogtreecommitdiff
path: root/src/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.php')
-rw-r--r--src/index.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/index.php b/src/index.php
index 460a80f..5154ce8 100644
--- a/src/index.php
+++ b/src/index.php
@@ -657,15 +657,15 @@ questions?</textarea>
657 657
658 ctx.font = `${fontSize}px ${fontStack}`; 658 ctx.font = `${fontSize}px ${fontStack}`;
659 ctx.fillStyle = this.settings.fg; 659 ctx.fillStyle = this.settings.fg;
660 ctx.textBaseline = 'alphabetic'; 660 ctx.textBaseline = 'middle';
661 661
662 const lineH = fontSize * this.settings.lineSpacing; 662 const lineH = fontSize * this.settings.lineSpacing;
663 const totalH = lineH * (slide.lines.length - 1) + fontSize; 663 const totalH = slide.lines.length * lineH;
664 const startX = marginX; 664 const startX = marginX;
665 const startY = (H - totalH) / 2 + fontSize; // first baseline 665 const startY = (H - totalH) / 2;
666 666
667 slide.lines.forEach((line, i) => { 667 slide.lines.forEach((line, i) => {
668 ctx.fillText(line, startX, startY + i * lineH); 668 ctx.fillText(line, startX, startY + (i + 0.5) * lineH);
669 }); 669 });
670 } 670 }
671 671