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
+18 -12
View File
@@ -17,14 +17,14 @@ class BookPageFormatModule extends BaseModule {
margins: Object.freeze({
topIn: 0.46,
bottomIn: 0.58,
innerIn: 0.68,
outerIn: 0.46
innerIn: 0.62,
outerIn: 0.72
}),
typography: Object.freeze({
fontFamily: '"EB Garamond", "EB Garamond 12", serif',
bodyFontSizePt: 10.8,
lineHeightPt: 14.9,
headingFontSizePt: 13.2,
linesPerPage: 25,
bodyLineRatio: 1.5,
headingScale: 1,
dropCapLines: 2
})
});
@@ -63,18 +63,24 @@ class BookPageFormatModule extends BaseModule {
inner: this.inchesToTexture(this.format.margins.innerIn, height),
outer: this.inchesToTexture(this.format.margins.outerIn, height)
};
const content = {
x: margins.outer,
y: margins.top,
width: Math.max(1, width - margins.outer - margins.inner),
height: Math.max(1, height - margins.top - margins.bottom)
};
const linesPerPage = Math.max(1, Number(this.format.typography.linesPerPage || 25));
const typographyLineHeightPx = content.height / linesPerPage;
const bodyFontSizePx = typographyLineHeightPx / Math.max(1, Number(this.format.typography.bodyLineRatio || 1.5));
return {
width,
height,
aspectRatio: this.getAspectRatio(),
margins,
content: {
x: margins.outer,
y: margins.top,
width: Math.max(1, width - margins.outer - margins.inner),
height: Math.max(1, height - margins.top - margins.bottom)
},
typographyLineHeightPx: this.inchesToTexture(this.format.typography.lineHeightPt / 72, height),
content,
linesPerPage,
bodyFontSizePx,
typographyLineHeightPx,
typography: this.format.typography
};
}