fix: 保留的坐标精度
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user