Restore WebGL control overlay and page grid

This commit is contained in:
2026-06-06 15:17:50 +02:00
parent 9836c68ffa
commit bc736513d4
7 changed files with 78 additions and 28 deletions
+2 -1
View File
@@ -120,6 +120,7 @@ class BookTextureRendererModule extends BaseModule {
const metrics = this.metrics;
const fontPx = Math.max(1, Number(lineRecord.fontPx || 22));
const lineHeightPx = Math.max(fontPx + 2, Number(lineRecord.lineHeightPx || metrics.typographyLineHeightPx || 30));
const fontStyle = lineRecord.fontStyle === 'italic' ? 'italic ' : '';
const line = lineRecord.line || {};
const nodes = Array.isArray(line.nodes) ? line.nodes : [];
const baseY = metrics.content.y + (Number(lineRecord.pageLine || 0) * lineHeightPx) + fontPx;
@@ -133,7 +134,7 @@ class BookTextureRendererModule extends BaseModule {
: Number(line.offset || 0);
let x = metrics.content.x + centerOffset;
ctx.font = `${fontPx}px ${metrics.typography.fontFamily}`;
ctx.font = `${fontStyle}${fontPx}px ${metrics.typography.fontFamily}`;
nodes.forEach((node, index) => {
if (!node) return;
if (node.type === 'box' && node.value) {