修复尺寸线空间的问题

This commit is contained in:
sladro 2025-12-31 10:35:35 +08:00
parent 257cef976c
commit e44a9a81ab
2 changed files with 12 additions and 3 deletions

View File

@ -1905,7 +1905,7 @@ namespace CadParamPluging.Cad
TrySetDimProp(dim, "Dimasz", 2.5);
TrySetDimProp(dim, "Dimgap", 1.0);
TrySetDimProp(dim, "Dimexe", 1.0);
TrySetDimProp(dim, "Dimexo", 1.0);
TrySetDimProp(dim, "Dimexo", 0.0);
// Updated based on user request
TrySetDimProp(dim, "Dimtofl", true); // Draw dim line between ext lines

View File

@ -1605,7 +1605,12 @@ namespace CadParamPluging.Cad
var isBottomEdge = Math.Abs(startPt.Y - layout.MinPoint.Y) < tolerance;
if (isTopEdge || isBottomEdge)
{
return true;
// 增加长度判断:防止误删位于边界上的短线(如标题栏边框)
// 只有长度超过布局宽度 50% 的线才认为是外框
if (Math.Abs(startPt.X - endPt.X) > layoutWidth * 0.5)
{
return true;
}
}
}
@ -1618,7 +1623,11 @@ namespace CadParamPluging.Cad
var isRightEdge = Math.Abs(startPt.X - layout.MaxPoint.X) < tolerance;
if (isLeftEdge || isRightEdge)
{
return true;
// 增加长度判断
if (Math.Abs(startPt.Y - endPt.Y) > layoutHeight * 0.5)
{
return true;
}
}
}
}