feat(deps): 依赖连线自动错开 + 拖拽调整走线(三种视图);发布 v1.3.3

- 新增共享走线模块 lib/layout/dep_routes.dart:条形 / 圆周的走线、标签
  挂钩与外移判定、命中测试统一到同一份几何(绘制与命中不再各算一套);
- 自动错开:同一走线分组(同泳道 / 相邻泳道对 / 跨行对)内的多条依赖
  依次 ±6px 错开,解决“多条线完全重叠”;
- 手动走线偏移:Dependency.routeOffset(随工程保存)——
  · 条形 / 流程图:上下拖动平移横线,跨行走廊为左右拖动;
  · 圆周:沿半径方向(法线)拖动;
  · 直角拐点随平移保留,双击连线或右键「复位走线偏移」恢复自动位置;
  · 选中连线以强调色加粗高亮,状态栏给出操作提示;
- 画布命中判定改用「按下位置」(此前用手势验收点,细目标会抓空),
  端点把手与连线重叠时按“谁更近”判定优先级;
- 帮助中心补充「连线重叠怎么办」;版本号 1.3.3+19;
  更新说明 release/RELEASE_NOTES_v1.3.3.md。
This commit is contained in:
2026-10-09 21:27:40 +08:00
parent c352af2359
commit b902fa06c4
15 changed files with 920 additions and 233 deletions
+11 -1
View File
@@ -124,12 +124,15 @@ class Dependency {
/// 构造一条依赖。
///
/// 参数 [fromId]:前驱动作 id;[toId]:后继动作 id;
/// [type]:依赖类型,默认 [DepType.fs];[offsetAngle]:附加相位偏移(度)。
/// [type]:依赖类型,默认 [DepType.fs];[offsetAngle]:附加相位偏移(度);
/// [routeOffset]:手动走线偏移(px)——条形 / 流程图作用于横向走线的纵向偏移,
/// 圆周视图作用于绕行圆弧的半径偏移,用于拉开重叠的连线。
const Dependency({
required this.fromId,
required this.toId,
this.type = DepType.fs,
this.offsetAngle = 0,
this.routeOffset = 0,
});
/// 前驱动作 id。
@@ -144,18 +147,23 @@ class Dependency {
/// 依赖的附加角度偏移,单位:度。
final double offsetAngle;
/// 手动走线偏移(px,默认 0):拖拽连线调整,见 `dep_routes.dart`。
final double routeOffset;
/// 基于当前实例创建副本,未提供的参数保持原值。
Dependency copyWith({
String? fromId,
String? toId,
DepType? type,
double? offsetAngle,
double? routeOffset,
}) {
return Dependency(
fromId: fromId ?? this.fromId,
toId: toId ?? this.toId,
type: type ?? this.type,
offsetAngle: offsetAngle ?? this.offsetAngle,
routeOffset: routeOffset ?? this.routeOffset,
);
}
@@ -165,6 +173,7 @@ class Dependency {
'toId': toId,
'type': type.name.toUpperCase(),
'offsetAngle': offsetAngle,
if (routeOffset != 0) 'routeOffset': routeOffset,
};
/// 从 JSON 反序列化;缺失字段使用安全默认值,保证旧文件可加载。
@@ -174,6 +183,7 @@ class Dependency {
toId: j['toId'] as String? ?? '',
type: _depTypeFrom(j['type'] as String?),
offsetAngle: (j['offsetAngle'] as num?)?.toDouble() ?? 0,
routeOffset: (j['routeOffset'] as num?)?.toDouble() ?? 0,
);
}