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

Function asset_user_text

perro_editor/res/scripts/ui/editor_ui.rs:2430–2466  ·  view source on GitHub ↗
(state: &EditorState, path: &str)

Source from the content-addressed store, hash-verified

2428 0.20
2429 } else {
2430 match row.components.len() {
2431 2 => 0.42,
2432 3 => 0.28,
2433 4 => 0.20,
2434 _ => 0.28,
2435 }
2436 };
2437 for component in 0..4 {
2438 let box_name = format!("inspector_var_{idx}_{component}_box");
2439 let label_name = format!("inspector_var_{idx}_{component}_label");
2440 set_ui_node_size(&mut *ctx, &box_name, (box_w, 0.72));
2441 set_text_box_text_ratio(&mut *ctx, &box_name, 0.50);
2442 set_text_box_padding(&mut *ctx, &box_name, 4.0, 1.0);
2443 set_text_box_h_align(&mut *ctx, &box_name, UiTextAlign::Center);
2444 set_label_size_ratio(&mut *ctx, &label_name, (0.28, 1.0));
2445 set_label_text_ratio(&mut *ctx, &label_name, 0.46);
2446 set_axis_label_overlay(&mut *ctx, &label_name);
2447 }
2448}
2449
2450fn inspector_row_subtree_heights(rows: &[InspectorValueRow], base_heights: &[f32]) -> Vec<f32> {
2451 let mut out = base_heights.to_vec();
2452 for idx in (0..rows.len()).rev() {
2453 let depth = rows[idx].depth;
2454 let mut next = idx + 1;
2455 let mut child_count = 0;
2456 while next < rows.len() && rows[next].depth > depth {
2457 if rows[next].depth == depth + 1 {
2458 out[idx] += out[next];
2459 child_count += 1;
2460 }
2461 next += 1;
2462 }
2463 if child_count > 0 {
2464 out[idx] += if rows[idx].source == "section" {
2465 0.014
2466 } else {
2467 0.008
2468 };
2469 }

Callers 1

asset_ref_textFunction · 0.85

Calls 6

cached_scene_doc_sharedFunction · 0.85
node_uses_asset_pathFunction · 0.85
is_emptyMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected