fix(ui): 修复「适应视图」条形视图缩小后偏到左上角;发布 v1.2.3

- fitView 条形分支:内容被缩小时按内容范围居中显示
  (此前固定 pan=0,动作较多触发缩小时画面会钉在左上角)
- 圆周视图行为不变(原本即按圆心居中计算)
- tool/check_update.dart 改用 package 导入并声明 ignore,flutter analyze 归零
- 版本号 1.2.3+15
This commit is contained in:
2026-10-09 10:24:48 +08:00
parent 440e017203
commit fe2008b604
9 changed files with 57 additions and 45 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ flutter pub get
flutter build apk --release # 产物:build\app\outputs\flutter-apk\app-release.apk
```
- 发布包归档:`release\sequence_diagram_android_v1.2.2_release.apk`(**本地保留,不入库**;exe 的 `dist\` 同理)。
- 发布包归档:`release\sequence_diagram_android_v1.2.3_release.apk`(**本地保留,不入库**;exe 的 `dist\` 同理)。
- 上架应用商店时建议在 `android\app\build.gradle.kts` 配置正式签名后再构建 AAB:
`flutter build appbundle --release`。
- 应用名「时序图设计」、包名 `cc.sincos.sequence_diagram`、launcher 图标由
+3 -3
View File
@@ -9,7 +9,7 @@
- **深色 / 浅色双主题**:右上角 ☀ / ☾ 一键切换,语义颜色不变,导出 SVG 与屏幕一致
- **导出 SVG**:矢量、分层、带语义 `id` / `data-*` 元数据,可直接进工艺卡与 MES
## 正式版 V1.2.2
## 正式版 V1.2.3
**可运行的 Flutter Windows 桌面正式版**(源码在 `lib/`),设计人:呆头鹅。
@@ -97,7 +97,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模
- **正式签名**:release 用独立 keystore 签名(`android/key/release.jks`,见 `BUILD-NOTES.md`),更新安装无需卸载重装;
- **构建**:JDK 17 + Android SDK 36(详见 `BUILD-NOTES.md`),Gradle 与 Maven 已配置国内镜像:
```bash
flutter build apk --release # 产物 → release/sequence_diagram_android_v1.2.2_release.apk
flutter build apk --release # 产物 → release/sequence_diagram_android_v1.2.3_release.apk
```
- **自测**:`test/tablet_layout_test.dart` 覆盖 1280×800、2560×1600、960×600、800×480、竖屏 800×1280、600×960 等 7 种分辨率的无溢出回归;
- **demo 图**:`demo/tablet-*.png`(由 `test/tablet_screenshots_test.dart` 生成)。
@@ -113,6 +113,6 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模
- **软件**:时序图设计 · Sequence Diagram Studio
- **设计人**:呆头鹅
- **版本**:V1.2.2
- **版本**:V1.2.3
- **版权**:Copyright © 2026 呆头鹅。保留所有权利。
- **架构文档**:[`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) · **使用帮助**:[`docs/HELP.md`](docs/HELP.md)
+5 -2
View File
@@ -456,11 +456,14 @@ class AppController extends ChangeNotifier {
py = vp.height / 2 - center.dy * z;
} else {
final BarLayout l = BarLayout(_project, vp);
// 内容逻辑范围:(0,0) → 右缘 + 60、最后一行底部 + 40。
final double contentW = l.plotRight + 60;
final double contentH = l.yFor(l.ordered.length) + 40;
z = math.min(vp.width / contentW, vp.height / contentH).clamp(0.25, 1.0);
px = 0;
py = 0;
// 关键修复:内容被缩小时按内容范围居中显示;内容本来就能放下时保持默认位置。
// (此前固定 pan = 0,缩小的画面会被钉在左上角。)
px = z < 1 ? (vp.width - contentW * z) / 2 : 0;
py = z < 1 ? (vp.height - contentH * z) / 2 : 0;
}
_project = _project.copyWith(
viewState: _project.viewState.copyWith(zoom: z, panX: px, panY: py),
+1 -1
View File
@@ -2124,7 +2124,7 @@ class HelpDialog extends StatelessWidget {
Text('时序图设计 · Sequence Diagram Studio',
style: TextStyle(color: t.text, fontSize: 15, fontWeight: FontWeight.w700)),
const SizedBox(height: 4),
Text('V1.2.2(${android ? '安卓版' : 'Windows 版'})',
Text('V1.2.3(${android ? '安卓版' : 'Windows 版'})',
style: TextStyle(color: t.dim, fontSize: 12)),
],
),
+1 -1
View File
@@ -2,4 +2,4 @@
///
/// 应用内更新检查用它判断服务器发布的版本是否更新;
/// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。
const String kAppVersion = '1.2.2';
const String kAppVersion = '1.2.3';
+32 -32
View File
@@ -6,7 +6,7 @@ packages:
description:
name: async
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.13.1"
boolean_selector:
@@ -14,7 +14,7 @@ packages:
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
characters:
@@ -22,7 +22,7 @@ packages:
description:
name: characters
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
clock:
@@ -30,7 +30,7 @@ packages:
description:
name: clock
sha256: e51d50bca3217c9a9fa2b41a30e4a38971133f5f9ec7a3d57bae095007f1d28e
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.3"
collection:
@@ -38,7 +38,7 @@ packages:
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.19.1"
crypto:
@@ -46,7 +46,7 @@ packages:
description:
name: crypto
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.7"
cupertino_icons:
@@ -54,7 +54,7 @@ packages:
description:
name: cupertino_icons
sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.9"
fake_async:
@@ -62,7 +62,7 @@ packages:
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
fixnum:
@@ -70,7 +70,7 @@ packages:
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flutter:
@@ -83,7 +83,7 @@ packages:
description:
name: flutter_lints
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
flutter_riverpod:
@@ -91,7 +91,7 @@ packages:
description:
name: flutter_riverpod
sha256: "2b7f9d2a3c730ac1a98221b420cef966b990fca7ab546ede324642ca57a533e3"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.4.3"
flutter_test:
@@ -104,7 +104,7 @@ packages:
description:
name: leak_tracker
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "11.0.2"
leak_tracker_flutter_testing:
@@ -112,7 +112,7 @@ packages:
description:
name: leak_tracker_flutter_testing
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.10"
leak_tracker_testing:
@@ -120,7 +120,7 @@ packages:
description:
name: leak_tracker_testing
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
lints:
@@ -128,7 +128,7 @@ packages:
description:
name: lints
sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "6.1.0"
listen:
@@ -136,7 +136,7 @@ packages:
description:
name: listen
sha256: "47501a08016a43fcad79252439d723f50f14f88fa7bfd8a177e0a417e5c9e1f2"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
matcher:
@@ -144,7 +144,7 @@ packages:
description:
name: matcher
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.12.20"
material_color_utilities:
@@ -152,7 +152,7 @@ packages:
description:
name: material_color_utilities
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.13.0"
meta:
@@ -160,7 +160,7 @@ packages:
description:
name: meta
sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.19.0"
path:
@@ -168,7 +168,7 @@ packages:
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
riverpod:
@@ -176,7 +176,7 @@ packages:
description:
name: riverpod
sha256: "484dfc873ea4c4f4240e5635444fa066f87b07862b7279ebd004a2b71fba4b7a"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "3.4.3"
sky_engine:
@@ -189,7 +189,7 @@ packages:
description:
name: source_span
sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.10.2"
stack_trace:
@@ -197,7 +197,7 @@ packages:
description:
name: stack_trace
sha256: "277654b3034d17ac6f9f1cb5595db011b1d5d41e8806866db28e0abaa101c490"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.12.2"
state_notifier:
@@ -205,7 +205,7 @@ packages:
description:
name: state_notifier
sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
stream_channel:
@@ -213,7 +213,7 @@ packages:
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
string_scanner:
@@ -221,7 +221,7 @@ packages:
description:
name: string_scanner
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
term_glyph:
@@ -229,7 +229,7 @@ packages:
description:
name: term_glyph
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test_api:
@@ -237,7 +237,7 @@ packages:
description:
name: test_api
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.7.12"
typed_data:
@@ -245,7 +245,7 @@ packages:
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
uuid:
@@ -253,7 +253,7 @@ packages:
description:
name: uuid
sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "4.6.0"
vector_math:
@@ -261,7 +261,7 @@ packages:
description:
name: vector_math
sha256: "92b9910f66ed1057fd4da7b040ae7c74cafacf885bdc81be496928d5049b032d"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.4.3"
vm_service:
@@ -269,7 +269,7 @@ packages:
description:
name: vm_service
sha256: "5f37239c4851efcef929cea7824e76df7f2f0970aef85d66bbc430afa40e72f0"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "15.3.0"
sdks:
+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
# 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.
version: 1.2.2+14
version: 1.2.3+15
environment:
sdk: ^3.13.3
+5
View File
@@ -0,0 +1,5 @@
# V1.2.3 更新内容
- 修复「适应视图」在条形视图动作较多时的显示问题:画面被缩小后现在会**居中显示**,
不再偏移到左上角(此前固定 pan=0 导致缩小的内容钉在左上角)
- 圆周视图的适应视图行为保持不变(本来就是居中计算)
+8 -4
View File
@@ -2,11 +2,15 @@
//
// 用途:验证更新链路(网络可达 / 接口解析 / 版本判定 / 附件匹配)。
// 运行:
// dart run tool\check_update.dart
// dart run tool\check_update.dart # 用当前版本检查
// dart run tool\check_update.dart 1.2.1 # 模拟旧版本,验证「发现更新」路径
//
// 说明:使用的是与客户端完全相同的 lib/update/update_service.dart。
import '../lib/update/update_service.dart';
import '../lib/version.dart';
// 说明:使用的是与客户端完全相同的 lib/update/update_service.dart;
// 本文件是命令行工具,直接向控制台打印结果属预期用法。
//
// ignore_for_file: avoid_print
import 'package:sequence_diagram/update/update_service.dart';
import 'package:sequence_diagram/version.dart';
Future<void> main(List<String> args) async {
// 可传入一个版本号模拟旧安装(如 `dart run tool\check_update.dart 1.2.1`)。