From 1c0347c32b3f20c9eb4b482b1535ff8a1e9518c3 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 23 四月 2024 11:18:48 +0800 Subject: [PATCH] # --- src/utils/common.js | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/utils/common.js b/src/utils/common.js index 4806db1..01b74cc 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -19,7 +19,12 @@ } export const rotationParseNum = (num) => { - return num * Math.PI / 180; + const normalizedDegrees = num % 360; + return normalizedDegrees * Math.PI / 180; +} + +export const minDiffTheta = (originTheta, targetTheta) => { + return (targetTheta - originTheta > 180) ? targetTheta - 360 : targetTheta; } export const setShadow = (obj) => { -- Gitblit v1.9.1