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
+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';