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

Function asset_detail_text

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

Source from the content-addressed store, hash-verified

2466 } else {
2467 0.008
2468 };
2469 }
2470 }
2471 out
2472}
2473
2474fn apply_inspector_row_tree_layout<API: ScriptAPI + ?Sized>(
2475 ctx: &mut ScriptContext<'_, API>,
2476 idx: usize,
2477 parent_idx: Option<usize>,
2478 row: Option<&InspectorValueRow>,
2479 base_heights: &[f32],
2480 subtree_heights: &[f32],
2481) {
2482 let base = base_heights.get(idx).copied().unwrap_or(0.031);
2483 let total = subtree_heights.get(idx).copied().unwrap_or(base).max(base);
2484 let child_total = (total - base).max(0.0);
2485 let parent_child_total = parent_idx
2486 .and_then(|parent| {
2487 let parent_base = base_heights.get(parent).copied()?;
2488 let parent_total = subtree_heights.get(parent).copied()?;
2489 Some((parent_total - parent_base).max(0.0))
2490 })
2491 .unwrap_or(1.0)
2492 .max(0.0001);
2493 let root_h = if parent_idx.is_some() {
2494 total / parent_child_total
2495 } else {
2496 total
2497 };

Callers 1

asset_inspector_textFunction · 0.85

Calls 6

panim_summaryFunction · 0.85
text_asset_previewFunction · 0.85
cached_scene_doc_sharedFunction · 0.85
cloneMethod · 0.80
is_emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected