mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-16 16:15:59 +00:00
fix(renderer): correct pie slice angle conversion
This commit is contained in:
1 parent
407d4f3a2c
commit
8ab45eb5ea
2 files changed
+20
-3
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user