fix: 保留的坐标精度

This commit is contained in:
起个名字好难的喵
2025-07-26 17:34:38 +08:00
parent e63f593b94
commit 40c0fb33fb

View File

@@ -205,7 +205,7 @@ def process_coordinates(positions):
for axis in ['x', 'y']: for axis in ['x', 'y']:
if axis in pos and isinstance(pos[axis], (int, float)): if axis in pos and isinstance(pos[axis], (int, float)):
original = pos[axis] original = pos[axis]
pos[axis] = round(float(pos[axis]), 2) pos[axis] = round(float(pos[axis]), 4)
if original != pos[axis]: if original != pos[axis]:
coord_changed = True coord_changed = True
return coord_changed return coord_changed
@@ -591,7 +591,7 @@ def validate_file(file_path, auto_fix=False):
# 处理坐标 # 处理坐标
coord_changed = process_coordinates(data["positions"]) coord_changed = process_coordinates(data["positions"])
if coord_changed: if coord_changed:
all_corrections.append("坐标值自动保留位小数") all_corrections.append("坐标值自动保留位小数")
# 检查 BGI 版本兼容性 # 检查 BGI 版本兼容性
bgi_version, corrections = check_bgi_version_compatibility(info["bgi_version"], auto_fix) bgi_version, corrections = check_bgi_version_compatibility(info["bgi_version"], auto_fix)