summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkj_sh6042026-03-08 21:00:17 -0400
committerkj_sh6042026-03-08 21:00:17 -0400
commit158dbe06681f16131a0770665a521b13db7c7bb0 (patch)
treea9f5d1562d481ca9a3ba524742960bf6aa6adfc9 /src
parentd29192b67a4e1f88462d46d8608df98bc978da45 (diff)
fix: slight top offset on pdf render
Diffstat (limited to 'src')
-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