f4ef9b32a5
- 流程图视图:泳道 = 轨道、FS/SS 依赖连线、关键路径高亮、相位阶段栏 (每个动作行归属覆盖占比最大的分区,重叠分区台阶错位) - 无前置依赖的动作从「开始」并列引出(并行分支),无后继动作汇入「结束」 - 流程图只读:AI 生成 / 撤销重做 / 动作增删 / 属性与依赖编辑等入口自动置灰, 左栏视图模式只保留条形 / 圆周(流程图入口在顶部工具栏) - 导出升级:导出按钮合并为下拉菜单,SVG / PNG 三种视图通用; 流程图额外支持 drawio(diagrams.net 可继续编辑泳道 / 相位 / 依赖) - 连线走线统一收敛到 FlowLayout.routes,画布 / SVG / drawio 共用同一几何 - 默认示例升级为完整「装配线节拍」(8 动作 / 3 工位 / 4 相位分区) - 版本号 1.3.0+16,更新说明 release/RELEASE_NOTES_v1.3.0.md
41 lines
1.7 KiB
Dart
41 lines
1.7 KiB
Dart
// 测试辅助:构造演示工程与加载中文字体(用于平板布局测试与截图生成)。
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter/services.dart';
|
|
import 'package:sequence_diagram/model/models.dart';
|
|
|
|
/// 构造一个动作较多、含依赖与相位分区的演示工程。
|
|
/// 演示工程:与内置默认工程完全一致(`Project.demo()`),
|
|
/// 保证「本地构建启动即所见」与演示截图的数据永远同步。
|
|
Project demoTiming() => Project.demo();
|
|
|
|
/// 从系统字体加载中文字体,使测试截图中的中文正常渲染。
|
|
Future<void> loadZhFonts() async {
|
|
const List<String> candidates = <String>[
|
|
r'C:\Windows\Fonts\simhei.ttf',
|
|
r'C:\Windows\Fonts\msyh.ttf',
|
|
r'C:\Windows\Fonts\msyh.ttc',
|
|
r'C:\Windows\Fonts\simsun.ttc',
|
|
];
|
|
for (final String path in candidates) {
|
|
final File f = File(path);
|
|
if (!f.existsSync()) continue;
|
|
final ByteData bytes = ByteData.sublistView(await f.readAsBytes());
|
|
final FontLoader loader = FontLoader('Microsoft YaHei UI')..addFont(Future<ByteData>.value(bytes));
|
|
await loader.load();
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// 从 Flutter SDK 加载 Material 图标字体,使测试截图中的图标正常渲染
|
|
/// (否则所有 Icon 会显示为空心方框)。
|
|
Future<void> loadMaterialIcons() async {
|
|
final String root = Platform.environment['FLUTTER_ROOT'] ?? '';
|
|
if (root.isEmpty) return;
|
|
final File f = File('$root/bin/cache/artifacts/material_fonts/MaterialIcons-Regular.otf');
|
|
if (!f.existsSync()) return;
|
|
final ByteData bytes = ByteData.sublistView(await f.readAsBytes());
|
|
final FontLoader loader = FontLoader('MaterialIcons')..addFont(Future<ByteData>.value(bytes));
|
|
await loader.load();
|
|
}
|