Fix a crash in the onboarding flow

This commit is contained in:
James Babcock committed 2026-10-17 16:29:02 -07:00
1 parent de653f0fbb
commit ba125ad413
2 files changed
+5 -3

No files matched your search

+3 -2
View File
@@ -99,8 +99,9 @@ export class TextSizePage implements OnboardingPage {
) + CONTENT_GAP;
const height = image.height - top - BOTTOM_MARGIN;
const body = onboardingFont("body");
const columnWidth = 20 + Math.max(...this.face.sizes.map((size) => body.measureText(sizeLabel(size)))) +
NOTE_GAP + onboardingFont("detail").measureText(RECOMMENDED_NOTE);
// TTF widths are fractional; the menu's row images need whole pixels.
const columnWidth = Math.ceil(20 + Math.max(...this.face.sizes.map((size) => body.measureText(sizeLabel(size)))) +
NOTE_GAP + onboardingFont("detail").measureText(RECOMMENDED_NOTE));
const menuBox = { x: PAGE_X - 10, y: top, width: columnWidth, height };
this.sizeMenu.paint(image, menuBox, focused);
const previewX = menuBox.x + menuBox.width + COLUMN_GAP;