(state: &EditorState, path: &str, kind: &str)
| 2466 | } else { |
| 2467 | 0.008 |
| 2468 | }; |
| 2469 | } |
| 2470 | } |
| 2471 | out |
| 2472 | } |
| 2473 | |
| 2474 | fn 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 | }; |
no test coverage detected