MCPcopy Create free account
hub / github.com/PerroEngine/Perro / editor_ui_rect

Function editor_ui_rect

perro_editor/res/scripts/scene/editor_viewport.rs:2636–2664  ·  view source on GitHub ↗
(data: &SceneNodeData, parent: EditorUiRect)

Source from the content-addressed store, hash-verified

2634 begin_ui_drag(state, ctx.id.as_u64(), key, handle, pointer);
2635 state.log = format!("resize node\n{handle}");
2636 }
2637 });
2638 refresh_all(ctx);
2639 return;
2640 }
2641 if tool == "rotate"
2642 && let Some(pointer) = pointer
2643 && pick_rotation_zone(ctx, pointer).is_some()
2644 {
2645 let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
2646 if let Some(key) = state.selected_key {
2647 begin_ui_drag(state, ctx.id.as_u64(), key, "rotate", pointer);
2648 state.log = "rotate node".to_string();
2649 }
2650 });
2651 refresh_all(ctx);
2652 return;
2653 }
2654 let Some(key) = pick_preview_ui(ctx) else {
2655 deselect_viewport_node(ctx, "deselect\nui empty");
2656 return;
2657 };
2658 let _ = with_state_mut!(ctx.run, EditorState, ctx.id, |state| {
2659 state.selected_key = Some(key);
2660 state.ui_drag_key = None;
2661 state.ui_drag_mode.clear();
2662 if tool == "move" {
2663 if let Some(pointer) = pointer {
2664 begin_ui_drag(state, ctx.id.as_u64(), key, "move", pointer);
2665 }
2666 state.log = format!("move node\nkey={key}");
2667 } else {

Callers 2

pick_doc_ui_node_innerFunction · 0.85
doc_ui_rect_indexedFunction · 0.85

Calls 6

scene_anchor_dirFunction · 0.85
scene_field_vec2Function · 0.85
scene_field_f32Function · 0.85
type_nameMethod · 0.80
scene_field_boolFunction · 0.70
scene_field_strFunction · 0.70

Tested by

no test coverage detected