fix: merge 模式下 镜像和旋转功能与前端对其
All checks were successful
git commit AiDA python develop 分支构建部署 / scheduled_deploy (push) Has been skipped

This commit is contained in:
zcr
2026-01-24 14:43:10 +08:00
parent f78809b22a
commit ecf10611c2

View File

@@ -367,7 +367,7 @@ def transpose_rotate(layer, image):
# ------------------- 核心修改:计算实际旋转角度 -------------------
# 结合镜像状态,计算需要实际执行的旋转角度
actual_rotate = calculate_actual_rotate(original_rotate, is_mirrored_x, is_mirrored_y)
print(f"actual_rotate:{actual_rotate}")
# ------------------- 执行镜像变换 -------------------
# 左右镜像transpose[0] != 1 即-1表示镜像
if is_mirrored_x != 1:
@@ -416,8 +416,8 @@ def calculate_actual_rotate(before_rotate, is_mirrored_x, is_mirrored_y):
actual_rotate = -before_rotate
elif is_mirrored_x == 1 and is_mirrored_y == -1:
actual_rotate = -before_rotate
elif is_mirrored_x == -1 and is_mirrored_y == -1:
actual_rotate = before_rotate + 180
# elif is_mirrored_x == -1 and is_mirrored_y == -1:
# actual_rotate = before_rotate + 180
# 角度标准化到0-360度
normalized_rotate = ((actual_rotate % 360) + 360) % 360