统一分离树文件格式

按仓库 rustfmt 规范整理 synthetic root 实现
This commit is contained in:
2026-09-09 00:52:48 +08:00
parent 19f3d62d78
commit 207b0820dd
@@ -1,5 +1,5 @@
use super::model::*;
use crate::ui_editor::component::{image::ImageComponent, Component};
use crate::ui_editor::component::{Component, image::ImageComponent};
use crate::ui_editor::layout::node::Node;
use crate::ui_editor::state::{State, UITree};
use crate::ui_editor::utils::NodeId;
@@ -88,11 +88,8 @@ pub fn construct_separation_state(state: &State) -> SeparationState {
// The synthetic root must never share an ID with a real
// UI node. A single-image design may use the original
// tree root as an eligible separation leaf.
id: NodeId::new(format!(
"separation-root-{}",
uuid::Uuid::new_v4().simple()
))
.expect("synthetic separation root id is valid"),
id: NodeId::new(format!("separation-root-{}", uuid::Uuid::new_v4().simple()))
.expect("synthetic separation root id is valid"),
global_pos_x_px: 0,
global_pos_y_px: 0,
width_px: image.pixel_size.x.max(0.0).round() as u32,