WIP: UI编辑器自动分图层切图标 #304

Draft
k88936 wants to merge 100 commits from feat/ui-editor-auto-seperation into master
Showing only changes of commit 207b0820dd - Show all commits
@@ -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,