v1.3.10: 应用身份切换 cc.sincos.edc(彻底解决桌面名称); 移除尺寸标注与图元库自定义; 修复帮助中心空白与 Windows 更新包校验

This commit is contained in:
2026-10-11 21:38:18 +08:00
parent d26991593a
commit f42caa3657
30 changed files with 143 additions and 1178 deletions
-63
View File
@@ -1030,71 +1030,8 @@ class ArchPainter extends CustomPainter {
: 12.5,
);
}
// 尺寸标注(识别后图形 / 曲线 / 图元可直接改值缩放;标签屏幕字号恒定)。
if (s.dims.isNotEmpty) {
final double z = doc.zoom < 0.05 ? 1 : doc.zoom;
final List<ArchDimKind> kinds = <ArchDimKind>[
for (final ArchDimKind k in archShapeDimKinds(s))
if (s.dims.contains(k)) k,
];
for (int i = 0; i < kinds.length; i++) {
final ArchDimKind k = kinds[i];
_dimBadge(canvas, s, k, archShapeDimLabelPos(s, k, i, z), z);
}
}
}
/// 尺寸标签(小圆角底片 + 数值;屏幕尺寸恒定,双击可改值)。
void _dimBadge(
Canvas canvas,
ArchShape s,
ArchDimKind k,
Offset center,
double z,
) {
final double inv = 1 / z;
final double v = archShapeDimValue(s, k);
final String txt = switch (k) {
ArchDimKind.width => 'W ${_fmtDim(v)}',
ArchDimKind.height => 'H ${_fmtDim(v)}',
ArchDimKind.length => 'L ${_fmtDim(v)}',
ArchDimKind.diameter => '⌀ ${_fmtDim(v)}',
};
final TextPainter tp = TextPainter(
text: TextSpan(
text: txt,
style: TextStyle(
color: const Color(0xFF0F766E),
fontSize: 10 * inv,
fontWeight: FontWeight.w600,
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: const <String>['Microsoft YaHei', 'Segoe UI'],
),
),
textDirection: TextDirection.ltr,
)..layout();
final Rect r = Rect.fromCenter(
center: center,
width: tp.width + 8 * inv,
height: tp.height + 3 * inv,
);
final RRect rr = RRect.fromRectAndRadius(r, Radius.circular(4 * inv));
canvas.drawRRect(rr, Paint()..color = t.panel.withValues(alpha: 0.94));
canvas.drawRRect(
rr,
Paint()
..style = PaintingStyle.stroke
..strokeWidth = 1 * inv
..color = const Color(0xFF0F766E).withValues(alpha: 0.5),
);
tp.paint(canvas, r.center - Offset(tp.width / 2, tp.height / 2));
}
static String _fmtDim(double v) => (v - v.roundToDouble()).abs() < 0.05
? v.round().toString()
: v.toStringAsFixed(1);
/// 绘制连线(吸附端实时求边框交点;直线 / 正交折线;箭头 + 标签)。
void _connector(Canvas canvas, ArchConnector c) {
final ArchConnGeometry g =