diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/persistence.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/persistence.rs index 5edec22cc..5a0fdbadf 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/persistence.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/persistence.rs @@ -659,6 +659,16 @@ fn validate_node( { return Err("UI 节点 Transform 必须是有限数值".to_string()); } + if node + .layout + .transform + .anchor_min + .iter() + .chain(node.layout.transform.anchor_max.iter()) + .any(|value| *value < 0.0 || *value > 1.0) + { + return Err("UI 节点 Transform 的 anchor 必须处于 0..=1 范围".to_string()); + } if node .layout .transform