tui-lipan 0.1.0

Opinionated, component-based TUI framework for Rust - declarative components, reconciliation, layout engine, focus, overlays, and rich widgets on top of ratatui.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::layout::measure::min_size_constrained;

use super::drop_target::DropTarget;

pub(crate) fn measure_drop_target(
    target: &DropTarget,
    max_w: Option<u16>,
    max_h: Option<u16>,
) -> (u16, u16) {
    if let Some(child) = target.child.as_deref() {
        min_size_constrained(child, max_w, max_h)
    } else {
        (0, 0)
    }
}