fix(renderer): correct pie slice angle conversion

This commit is contained in:
tiennm99 committed 2026-07-06 23:44:41 +07:00
1 parent 407d4f3a2c
commit 8ab45eb5ea
2 files changed
+20 -3

No files matched your search

+3 -3
View File
@@ -28,10 +28,10 @@ export const getFinalWheelRotationDegrees = (optionCount, winnerIndex, fullTurns
fullTurns * fullTurnDegrees - getSliceCenterDegrees(optionCount, winnerIndex);
/**
* Converts CSS angle convention to @remotion/shapes Pie convention, where 0deg
* starts at 12h.
* Converts CSS angle convention to @remotion/shapes Pie radians. Pie rotation
* 0 starts at 12h, so CSS 0deg at 3h needs a quarter-turn offset.
*
* @param {number} cssDegrees
* @returns {number}
*/
export const cssDegreesToPieRadians = (cssDegrees) => ((cssDegrees - 90) * Math.PI) / 180;
export const cssDegreesToPieRadians = (cssDegrees) => ((cssDegrees - 270) * Math.PI) / 180;