fix: merge 模式下 镜像和旋转功能与前端对其
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped
This commit is contained in:
@@ -367,7 +367,7 @@ def transpose_rotate(layer, image):
|
|||||||
# ------------------- 核心修改:计算实际旋转角度 -------------------
|
# ------------------- 核心修改:计算实际旋转角度 -------------------
|
||||||
# 结合镜像状态,计算需要实际执行的旋转角度
|
# 结合镜像状态,计算需要实际执行的旋转角度
|
||||||
actual_rotate = calculate_actual_rotate(original_rotate, is_mirrored_x, is_mirrored_y)
|
actual_rotate = calculate_actual_rotate(original_rotate, is_mirrored_x, is_mirrored_y)
|
||||||
|
print(f"actual_rotate:{actual_rotate}")
|
||||||
# ------------------- 执行镜像变换 -------------------
|
# ------------------- 执行镜像变换 -------------------
|
||||||
# 左右镜像(transpose[0] != 1 即-1,表示镜像)
|
# 左右镜像(transpose[0] != 1 即-1,表示镜像)
|
||||||
if is_mirrored_x != 1:
|
if is_mirrored_x != 1:
|
||||||
@@ -416,9 +416,9 @@ def calculate_actual_rotate(before_rotate, is_mirrored_x, is_mirrored_y):
|
|||||||
actual_rotate = -before_rotate
|
actual_rotate = -before_rotate
|
||||||
elif is_mirrored_x == 1 and is_mirrored_y == -1:
|
elif is_mirrored_x == 1 and is_mirrored_y == -1:
|
||||||
actual_rotate = -before_rotate
|
actual_rotate = -before_rotate
|
||||||
elif is_mirrored_x == -1 and is_mirrored_y == -1:
|
# elif is_mirrored_x == -1 and is_mirrored_y == -1:
|
||||||
actual_rotate = before_rotate + 180
|
# actual_rotate = before_rotate + 180
|
||||||
|
|
||||||
# 角度标准化到0-360度
|
# 角度标准化到0-360度
|
||||||
normalized_rotate = ((actual_rotate % 360) + 360) % 360
|
normalized_rotate = ((actual_rotate % 360) + 360) % 360
|
||||||
return normalized_rotate
|
return normalized_rotate
|
||||||
|
|||||||
Reference in New Issue
Block a user