3 Commits

15 changed files with 262 additions and 71 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 61 KiB

+24 -34
View File
@@ -710,9 +710,10 @@ ArchConnGeometry archConnectorGeometry(
} }
} }
// 无折点:自动单拐角(先横后竖 / 先竖后横由主方向决定)。 // 无折点:自动单拐角(先横后竖 / 先竖后横按两端射出点的主方向决定,
// 端点位置稳定,不随中心方向抖动)。
final bool horizontalFirst = final bool horizontalFirst =
(cTo.dx - cFrom.dx).abs() >= (cTo.dy - cFrom.dy).abs(); (b.dx - a.dx).abs() >= (b.dy - a.dy).abs();
final List<Offset> pts = horizontalFirst final List<Offset> pts = horizontalFirst
? <Offset>[a, Offset(b.dx, a.dy), b] ? <Offset>[a, Offset(b.dx, a.dy), b]
: <Offset>[a, Offset(a.dx, b.dy), b]; : <Offset>[a, Offset(a.dx, b.dy), b];
@@ -727,7 +728,11 @@ ArchConnGeometry archConnectorGeometry(
); );
} }
/// 正交走线的两端射出点(从图形边框取点;自由端点原样返回)。 /// 正交走线的两端射出点。
///
/// 稳定优先:端点**朝「保存的端点位置」(用户画线 / 拖拽的一侧)**在边框取点——
/// 不会随两图形中心方向的微小变化而左右乱跳;仅当保存端点接近中心
/// (程序化创建等)时,退回「朝向对方中心象限」的自动取向。
(Offset, Offset) _orthoEnds( (Offset, Offset) _orthoEnds(
ArchShape? sf, ArchShape? sf,
ArchShape? st, ArchShape? st,
@@ -736,48 +741,33 @@ ArchConnGeometry archConnectorGeometry(
Offset freeFrom, Offset freeFrom,
Offset freeTo, Offset freeTo,
) { ) {
final bool horizontalFirst =
(cTo.dx - cFrom.dx).abs() >= (cTo.dy - cFrom.dy).abs();
Offset a; Offset a;
Offset b; if (sf == null) {
if (horizontalFirst) { a = freeFrom;
a = sf == null } else if ((freeFrom - sf.rect.center).distance < 4) {
? freeFrom a = archBorderPoint(
: archBorderPoint(
sf, sf,
Offset( Offset(
cTo.dx >= cFrom.dx ? sf.rect.right + 1e5 : sf.rect.left - 1e5, cTo.dx >= cFrom.dx ? sf.rect.right + 1e5 : sf.rect.left - 1e5,
cFrom.dy,
),
);
b = st == null
? freeTo
: archBorderPoint(
st,
Offset(
cTo.dx >= cFrom.dx ? st.rect.left - 1e5 : st.rect.right + 1e5,
cTo.dy,
),
);
} else {
a = sf == null
? freeFrom
: archBorderPoint(
sf,
Offset(
cFrom.dx,
cTo.dy >= cFrom.dy ? sf.rect.bottom + 1e5 : sf.rect.top - 1e5, cTo.dy >= cFrom.dy ? sf.rect.bottom + 1e5 : sf.rect.top - 1e5,
), ),
); );
b = st == null } else {
? freeTo a = archNearestBorderPoint(sf, freeFrom);
: archBorderPoint( }
Offset b;
if (st == null) {
b = freeTo;
} else if ((freeTo - st.rect.center).distance < 4) {
b = archBorderPoint(
st, st,
Offset( Offset(
cTo.dx, cFrom.dx >= cTo.dx ? st.rect.right + 1e5 : st.rect.left - 1e5,
cTo.dy >= cFrom.dy ? st.rect.top - 1e5 : st.rect.bottom + 1e5, cFrom.dy >= cTo.dy ? st.rect.bottom + 1e5 : st.rect.top - 1e5,
), ),
); );
} else {
b = archNearestBorderPoint(st, freeTo);
} }
return (a, b); return (a, b);
} }
+1
View File
@@ -727,6 +727,7 @@ class _AppShellState extends State<AppShell> {
onOpenSettings: () => _handleBrandCommand('_settings'), onOpenSettings: () => _handleBrandCommand('_settings'),
onOpenHelp: () => onOpenHelp: () =>
showDialog<void>(context: context, builder: (_) => const HelpDialog()), showDialog<void>(context: context, builder: (_) => const HelpDialog()),
onCheckUpdate: _openUpdate,
), ),
); );
} }
+84 -17
View File
@@ -2484,10 +2484,73 @@ Future<String?> showTextEditDialog(
return result; return result;
} }
class HelpDialog extends StatelessWidget { class HelpDialog extends StatefulWidget {
/// 构造帮助中心(左侧垂直导航 + 右侧内容,不再水平滑动)。
const HelpDialog({super.key}); const HelpDialog({super.key});
/// 渲染帮助中心:标签栏 + 各标签页的内容列表。 /// 创建状态。
@override
State<HelpDialog> createState() => _HelpDialogState();
}
/// 帮助中心状态:记录当前分页(左侧垂直导航索引)。
class _HelpDialogState extends State<HelpDialog> {
int _tab = 0;
/// 分页标题(与内容顺序一致)。
static const List<String> _tabs = <String>[
'首页与模块',
'时序图 · 动作',
'时序图 · 视图导出',
'架构图 · 绘制识别',
'架构图 · 尺寸导出',
'界面与快捷键',
'关于',
];
/// 左侧垂直导航条目。
Widget _navItem(Tokens t, int index, String label) {
final bool active = _tab == index;
return InkWell(
onTap: () => setState(() => _tab = index),
borderRadius: BorderRadius.circular(8),
child: Container(
margin: const EdgeInsets.only(bottom: 6),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 9),
decoration: BoxDecoration(
color: active
? t.accent.withValues(alpha: 0.14)
: Colors.transparent,
borderRadius: BorderRadius.circular(8),
border: Border.all(
color: active ? t.accent : Colors.transparent,
),
),
child: Row(
children: <Widget>[
Icon(
active ? Icons.chevron_right : Icons.circle,
size: active ? 15 : 6,
color: active ? t.accent : t.dim,
),
const SizedBox(width: 8),
Expanded(
child: Text(
label,
style: TextStyle(
color: active ? t.accent : t.sub,
fontSize: 12,
fontWeight: active ? FontWeight.w700 : FontWeight.w500,
),
),
),
],
),
),
);
}
/// 渲染帮助中心:左侧分页导航 + 右侧内容(垂直滚动)。
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Tokens t = context.tok; final Tokens t = context.tok;
@@ -2512,24 +2575,28 @@ class HelpDialog extends StatelessWidget {
), ),
const Divider(height: 22), const Divider(height: 22),
Expanded( Expanded(
child: DefaultTabController( child: Row(
length: 6, crossAxisAlignment: CrossAxisAlignment.stretch,
child: Column(
children: <Widget>[ children: <Widget>[
const TabBar( // 左侧:垂直导航(窄栏,内容过高时纵向滚动)。
isScrollable: true, SizedBox(
tabs: <Widget>[ width: 150,
Tab(text: '首页与模块'), child: ListView(
Tab(text: '时序图 · 动作'), children: <Widget>[
Tab(text: '时序图 · 视图导出'), for (int i = 0; i < _tabs.length; i++)
Tab(text: '架构图 · 绘制识别'), _navItem(t, i, _tabs[i]),
Tab(text: '架构图 · 尺寸导出'),
Tab(text: '界面与快捷键'),
Tab(text: '关于'),
], ],
), ),
),
const SizedBox(width: 12),
Container(width: 1, color: t.line2),
const SizedBox(width: 12),
// 右侧:当前分页内容(垂直滚动)。
Expanded( Expanded(
child: TabBarView( child: SingleChildScrollView(
key: ValueKey<int>(_tab),
child: IndexedStack(
index: _tab,
children: <Widget>[ children: <Widget>[
// 目标:从首页进入正确模块、理解文档与数据位置。 // 目标:从首页进入正确模块、理解文档与数据位置。
_section(t, <List<String>>[ _section(t, <List<String>>[
@@ -2610,8 +2677,8 @@ class HelpDialog extends StatelessWidget {
], ],
), ),
), ),
],
), ),
],
), ),
), ),
Align( Align(
+17 -2
View File
@@ -25,6 +25,7 @@ class HomeView extends StatefulWidget {
required this.onOpenRecent, required this.onOpenRecent,
required this.onOpenSettings, required this.onOpenSettings,
required this.onOpenHelp, required this.onOpenHelp,
required this.onCheckUpdate,
}); });
/// 全局控制器(只读展示用)。 /// 全局控制器(只读展示用)。
@@ -45,6 +46,9 @@ class HomeView extends StatefulWidget {
/// 帮助中心。 /// 帮助中心。
final VoidCallback onOpenHelp; final VoidCallback onOpenHelp;
/// 检查更新(真实按钮:检查中 / 已是最新 / 发现新版本都有明确反馈)。
final VoidCallback onCheckUpdate;
/// 创建状态。 /// 创建状态。
@override @override
State<HomeView> createState() => _HomeViewState(); State<HomeView> createState() => _HomeViewState();
@@ -210,7 +214,12 @@ class _HomeViewState extends State<HomeView> {
const SizedBox(width: 8), const SizedBox(width: 8),
_iconAction(t, Icons.help_outline, '帮助中心', widget.onOpenHelp), _iconAction(t, Icons.help_outline, '帮助中心', widget.onOpenHelp),
const SizedBox(width: 8), const SizedBox(width: 8),
UpdateIcon(size: 36, color: t.sub), _iconActionIcon(
t,
'检查更新',
widget.onCheckUpdate,
UpdateIcon(size: 22, color: t.sub),
),
], ],
); );
} }
@@ -218,6 +227,12 @@ class _HomeViewState extends State<HomeView> {
/// 圆形图标按钮(触屏 ≥ 44px 点按区)。 /// 圆形图标按钮(触屏 ≥ 44px 点按区)。
Widget _iconAction( Widget _iconAction(
Tokens t, IconData icon, String tip, VoidCallback onTap) { Tokens t, IconData icon, String tip, VoidCallback onTap) {
return _iconActionIcon(t, tip, onTap, Icon(icon, size: 20, color: t.sub));
}
/// 圆形按钮(自定义内容):与 [_iconAction] 同尺寸同风格。
Widget _iconActionIcon(
Tokens t, String tip, VoidCallback onTap, Widget child) {
return Tooltip( return Tooltip(
message: tip, message: tip,
child: InkWell( child: InkWell(
@@ -232,7 +247,7 @@ class _HomeViewState extends State<HomeView> {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all(color: t.line), border: Border.all(color: t.line),
), ),
child: Icon(icon, size: 20, color: t.sub), child: child,
), ),
), ),
); );
+1 -1
View File
@@ -2,7 +2,7 @@
/// ///
/// 应用内更新检查用它判断服务器发布的版本是否更新; /// 应用内更新检查用它判断服务器发布的版本是否更新;
/// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。 /// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。
const String kAppVersion = '1.3.7'; const String kAppVersion = '1.3.9';
/// 是否要求授权(License)才能导出。 /// 是否要求授权(License)才能导出。
/// ///
+1 -1
View File
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.3.7+29 version: 1.3.9+31
environment: environment:
sdk: ^3.13.3 sdk: ^3.13.3
+28
View File
@@ -0,0 +1,28 @@
# V1.3.8 更新内容
> ⚠️ 1.3.5 大版本的后续修复增强版。新功能仍可能存在较多 bug 与问题,
> 遇到问题欢迎反馈(开发者邮箱 liuyu65@126.com / 微信 online-goose)。
## 帮助中心:改为垂直排列(不再水平滑动)
- 帮助窗口改为**左侧垂直导航 + 右侧内容**:七个分页(首页与模块 / 时序图 ·
动作 / 时序图 · 视图导出 / 架构图 · 绘制识别 / 架构图 · 尺寸导出 /
界面与快捷键 / **关于**)纵向排列,点击即切换,不需要再左右滑动;
- 修复一处分页控制器长度不一致的问题(可能导致「关于」分页在部分情况下
点不开)。
## 连线端点捕捉稳定性修复("乱飘")
- 连线端点改为**按用户实际画线 / 拖拽的一侧**在图形边框上取点——
不再随两图形中心方向的微小变化在"右边 / 下边"之间乱跳;
- 只有程序化创建(端点恰在图形中心)时才退回"朝向对方"的自动取向;
- 自动单拐角方向也随之以实际端点为准,走线更符合直觉。
## 其它(1.3.7 修复回顾,如未更新过请一并获取)
- 安卓 logo 按钮与手绘按钮等高同形;「识别(N)」只识别当前墨迹;
移除示例场景入口;「尺寸 · mm」移到属性卡最上方;
- 修复编辑对话框在退场动画期间释放输入控制器导致的偶发异常。
> 安卓桌面若仍显示旧名称(如"时序图设计"):属桌面启动器缓存,
> 卸载后重新安装一次即可;应用内「关于」页可核对版本号为 1.3.8。
+32
View File
@@ -0,0 +1,32 @@
# V1.3.9 更新内容
> ⚠️ 1.3.5 大版本的后续修复版。新功能仍可能存在较多 bug 与问题,欢迎反馈
> (开发者邮箱 liuyu65@126.com / 微信 online-goose)。
## 首页「检查更新」按钮修复
- 之前首页右上角是一个**纯图标**(不可点击)——看似"假按钮";现在它是
真正的更新按钮:
- 点击 → 显示「正在检查更新…」;
- 已是最新:弹出提示「当前已是最新版本(vX)」;
- 发现新版本:直接弹出升级对话框(下载 / 安装)。
- 工具栏的更新按钮行为不变(一致)。
## 关于「安卓桌面仍显示旧名称(时序图设计)」
经核查:安装包内应用名称已确认为 **EDC|易得设计**(APK 实测 application-label),
且包名 `cc.sincos.sequence_diagram` 从第一个安卓版本起从未变过——不存在新旧
两个应用并存的情况。如果桌面仍显示旧名,请按下面两步定位:
1. **先确认装的是哪一版**:打开应用 → 首页底部「工程总体设计合集… v1.3.x」,
或「关于」页。若显示的不是 1.3.7+,说明新安装包**实际没有被装上**
(应用内更新流程可能被"安装未知应用"权限拦截),请到 Release 页手动下载
`*.apk` 安装;
2. 若已显示 1.3.9 而桌面名称仍旧:属**桌面启动器标签缓存**——请查看
系统「设置 → 应用 → 找到该应用」确认系统层名称(系统直读安装包,不缓存),
或重启手机 / 卸载后重装一次刷新桌面。
## 其它(如未更新过请一并获取)
- 帮助中心垂直导航、连线端点捕捉稳定(1.3.8);
- 安卓 logo 按钮等高同形、「识别」只识别当前墨迹、「尺寸 · mm」置顶(1.3.7)。
+24 -4
View File
@@ -84,8 +84,16 @@ if ($rel -and $rel.id) {
[System.IO.File]::WriteAllText($tmp, $payload, (New-Object System.Text.UTF8Encoding($false))) [System.IO.File]::WriteAllText($tmp, $payload, (New-Object System.Text.UTF8Encoding($false)))
Write-Host "创建 Release v$Version ..." Write-Host "创建 Release v$Version ..."
$resp = curl.exe -s --max-time 300 -X POST -H "Content-Type: application/json" --data-binary "@$tmp" -u $Auth "$Server/api/v1/repos/$Owner/$Repo/releases" $resp = curl.exe -s --max-time 300 -X POST -H "Content-Type: application/json" --data-binary "@$tmp" -u $Auth "$Server/api/v1/repos/$Owner/$Repo/releases"
$rel = $resp | ConvertFrom-Json # 响应解析容错:偶发 JSON 解析异常时按 tag 重新查询(创建可能已成功)。
if (-not $rel.id) { throw "创建 Release 失败:$resp" } $rel = $null
try { $rel = $resp | ConvertFrom-Json } catch { $rel = $null }
if (-not $rel -or -not $rel.id) {
curl.exe -s --max-time 300 -o $tagFile "$Server/api/v1/repos/$Owner/$Repo/releases/tags/v$Version" | Out-Null
try {
$rel = [System.IO.File]::ReadAllText($tagFile, [System.Text.Encoding]::UTF8) | ConvertFrom-Json
} catch { $rel = $null }
}
if (-not $rel -or -not $rel.id) { throw "创建 Release 失败:$resp" }
} }
Write-Host "Release id = $($rel.id)" Write-Host "Release id = $($rel.id)"
@@ -106,8 +114,20 @@ function Upload-Asset([string]$path) {
} catch {} } catch {}
Write-Host "上传附件:$name (限速 $UploadLimit)..." Write-Host "上传附件:$name (限速 $UploadLimit)..."
$r = curl.exe -s --limit-rate $UploadLimit -X POST -F "attachment=@$path" -u $Auth "$Server/api/v1/repos/$Owner/$Repo/releases/$($rel.id)/assets?name=$name" $r = curl.exe -s --limit-rate $UploadLimit -X POST -F "attachment=@$path" -u $Auth "$Server/api/v1/repos/$Owner/$Repo/releases/$($rel.id)/assets?name=$name"
$asset = $r | ConvertFrom-Json # 解析容错:异常时按 tag 复核附件是否已存在(上传可能已成功)。
if (-not $asset.name) { throw "上传失败:$r" } $asset = $null
try { $asset = $r | ConvertFrom-Json } catch { $asset = $null }
if (-not $asset -or -not $asset.name) {
curl.exe -s --max-time 300 -o $curFile "$Server/api/v1/repos/$Owner/$Repo/releases/tags/v$Version" | Out-Null
$okName = $false
try {
$cur2 = [System.IO.File]::ReadAllText($curFile, [System.Text.Encoding]::UTF8) | ConvertFrom-Json
foreach ($a in $cur2.assets) {
if ($a.name -eq $name) { $okName = $true; $asset = $a }
}
} catch {}
if (-not $okName) { throw "上传失败:$r" }
}
Write-Host " 完成:$($asset.browser_download_url)" Write-Host " 完成:$($asset.browser_download_url)"
} }
Upload-Asset $ApkPath Upload-Asset $ApkPath
+38
View File
@@ -801,6 +801,44 @@ void main() {
.reduce((double x, double y) => x < y ? x : y); .reduce((double x, double y) => x < y ? x : y);
expect(dmin, lessThan(2), reason: '路径应经过拖拽的角点'); expect(dmin, lessThan(2), reason: '路径应经过拖拽的角点');
}); });
test('端点捕捉稳定:按保存的画线侧取边框点(不随中心方向乱跳)', () {
const ArchShape a = ArchShape(
id: 'A',
type: ArchShapeType.rect,
rect: Rect.fromLTWH(0, 0, 100, 100),
);
const ArchShape b = ArchShape(
id: 'B',
type: ArchShapeType.rect,
rect: Rect.fromLTWH(300, 140, 100, 100),
);
final ArchDoc doc =
ArchDoc.empty.copyWith(shapes: <ArchShape>[a, b]);
final ArchConnector c1 = ArchConnector(
id: 'C1',
fromId: 'A',
from: const Offset(0, 50),
toId: 'B',
to: const Offset(350, 190),
);
// 从 A 的左侧画线:置左边中点 → 起点应留在左侧(目标在右下也不跳)。
final ArchConnGeometry g1 = archConnectorGeometry(doc, c1);
expect(g1.pts.first.dx, closeTo(0, 1));
// 从 A 的右侧画线:置右边中点 → 起点应留在右侧。
final ArchConnGeometry g2 =
archConnectorGeometry(doc, c1.copyWith(from: const Offset(100, 50)));
expect(g2.pts.first.dx, closeTo(100, 1));
// 保存端点为图形中心(程序化创建):退回朝向对方,且落在边框上。
final ArchConnGeometry g3 =
archConnectorGeometry(doc, c1.copyWith(from: a.rect.center));
final Offset p = g3.pts.first;
final bool onBorder = (p.dx - a.rect.left).abs() < 1 ||
(p.dx - a.rect.right).abs() < 1 ||
(p.dy - a.rect.top).abs() < 1 ||
(p.dy - a.rect.bottom).abs() < 1;
expect(onBorder, isTrue);
});
}); });
group('橡皮擦', () { group('橡皮擦', () {