From 124d94de93b4e83b54c0b074fa9dbc82162776d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 12 Sep 2026 21:27:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E8=AF=81=E7=B4=A0=E6=9D=90=E6=89=B9?= =?UTF-8?q?=E6=AC=A1=E8=A1=A5=E4=B8=81=E5=A4=B1=E8=B4=A5=E6=97=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=8E=9F=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在修改状态前预检所有成功绑定节点的裁剪路径,避免中途错误留下部分更新。 --- .../src/ui_editor/commands/separation/workflow/patch.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs index 39618548b..d8998f1c3 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/patch.rs @@ -30,6 +30,13 @@ pub fn apply_batch_patch( &batch, processed_dimensions, )?; + for decision in decisions { + if let BindingDecision::Ok { to_node, .. } = decision { + if !cut_paths.contains_key(to_node) { + return Err(format!("缺少节点 {} 的 cut 图片", to_node.as_str())); + } + } + } let rework_counts = batch_nodes .iter() .map(|node| (node.id.clone(), node.rework_count)) @@ -40,7 +47,7 @@ pub fn apply_batch_patch( BindingDecision::Ok { to_node, .. } => { let path = cut_paths .get(to_node) - .ok_or_else(|| format!("缺少节点 {} 的 cut 图片", to_node.as_str()))?; + .expect("cut path presence validated before patch"); state.bound.push(BoundNode { node_id: to_node.clone(), cut_image_path: path.clone(),