aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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>
ctx.font = `${fontSize}px ${fontStack}`;
ctx.fillStyle = this.settings.fg;
- ctx.textBaseline = 'alphabetic';
+ ctx.textBaseline = 'middle';
const lineH = fontSize * this.settings.lineSpacing;
- const totalH = lineH * (slide.lines.length - 1) + fontSize;
+ const totalH = slide.lines.length * lineH;
const startX = marginX;
- const startY = (H - totalH) / 2 + fontSize; // first baseline
+ const startY = (H - totalH) / 2;
slide.lines.forEach((line, i) => {
- ctx.fillText(line, startX, startY + i * lineH);
+ ctx.fillText(line, startX, startY + (i + 0.5) * lineH);
});
}