From ad677e8aad41dc9a628e4be9a620bbbbdb24fdd0 Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Wed, 26 Aug 2026 01:30:12 +0200 Subject: [PATCH] Fix wheel rendering angles to full circle --- public/wheel.js | 8 +++----- shared/camelot-angle.js | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/public/wheel.js b/public/wheel.js index ca0186c..4c24b38 100644 --- a/public/wheel.js +++ b/public/wheel.js @@ -58,11 +58,9 @@ function buildWheel(svgId, viewBoxSize, currentKey = null, compatIdxs = { primar const rOut = isMajor ? rOuter : rMid; const rIn = isMajor ? rMid : rInner; - // -7.5 to align 12B/12A so the center of the segment is at 0 degrees (top) - // The previous implementation had them start at 0, putting the segment from 0 to 15. - // We want the text to be at 0, so the segment goes from -7.5 to +7.5. - const a1 = window.codeToAngle[c] - 7.5; - const a2 = a1 + 15; + // -15 to align 12B/12A so the center of the segment is at 0 degrees (top) + const a1 = window.codeToAngle[c] - 15; + const a2 = a1 + 30; const aMid = (a1 + a2) / 2; const [x1,y1] = p(rOut, a1); diff --git a/shared/camelot-angle.js b/shared/camelot-angle.js index 94a2c03..02dbde9 100644 --- a/shared/camelot-angle.js +++ b/shared/camelot-angle.js @@ -1,16 +1,16 @@ const codeToAngle = { '12B': 0, '12A': 0, - '1B': 15, '1A': 15, - '2B': 30, '2A': 30, - '3B': 45, '3A': 45, - '4B': 60, '4A': 60, - '5B': 75, '5A': 75, - '6B': 90, '6A': 90, - '7B': 105, '7A': 105, - '8B': 120, '8A': 120, - '9B': 135, '9A': 135, - '10B': 150, '10A': 150, - '11B': 165, '11A': 165, + '1B': 30, '1A': 30, + '2B': 60, '2A': 60, + '3B': 90, '3A': 90, + '4B': 120, '4A': 120, + '5B': 150, '5A': 150, + '6B': 180, '6A': 180, + '7B': 210, '7A': 210, + '8B': 240, '8A': 240, + '9B': 270, '9A': 270, + '10B': 300, '10A': 300, + '11B': 330, '11A': 330, }; if (typeof module !== 'undefined' && module.exports) {