From f5edba0b64b66a1bdb255e0708e7578af6bbff42 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Mon, 22 Dec 2025 15:18:42 -0800 Subject: [PATCH] Improve docs on segmentedDigit --- .../addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts b/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts index b12ff1a0..8c094148 100644 --- a/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts +++ b/addons/addon-webgl/src/customGlyphs/CustomGlyphDefinitions.ts @@ -647,7 +647,9 @@ function sextant(pattern: number): { type: CustomGlyphDefinitionType.PATH_FUNCTI /** * Generates SVG path data for a 7-segment display digit. + * * Segment mapping (bit positions): + * * - bit 6: a (top) * - bit 5: b (upper right) * - bit 4: c (lower right) @@ -669,8 +671,9 @@ function sextant(pattern: number): { type: CustomGlyphDefinitionType.PATH_FUNCTI function segmentedDigit(pattern: number): string { const paths: string[] = []; - // Dimensions (in normalized 0-1 coordinates) - // Terminal cells are typically ~2:1 (height:width), so we use different values + // Each segment should have approximately the same stroke width, this is somewhat difficult to be + // precise since coordinates are 0-1 of the whole cell (percentage-based). To handle this, the + // fact that terminal cells are typically sized at ~2:1 (height:width) is leveraged. // for horizontal vs vertical to make segments appear the same thickness const segW = 0.15; // Width of vertical segments (fraction of cell width) const segH = 0.075; // Height of horizontal segments (fraction of cell height, ~half of segW for 2:1 cells)