Fix wheel rendering angles to full circle

This commit is contained in:
Jannik committed 2026-08-26 01:30:12 +02:00
1 parent 353c5d83c4
commit ad677e8aad
2 files changed
+14 -16

No files matched your search

+3 -5
View File
@@ -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);
+11 -11
View File
@@ -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) {