quadraui 0.6.1

Cross-platform Rust UI toolkit: write one AppLogic and run it unmodified on TUI, GTK4 (Linux), macOS, and Windows backends
Documentation
//! macOS layout helper for [`crate::TextInput`].
//!
//! Painting lives in the shared [`crate::primitives::text_input::paint`].
//! `MacBackend::draw_text_input` builds the layout via
//! [`mac_text_input_layout`] (a thin wrapper over the portable
//! [`crate::primitives::text_input::TextInput::layout`], the same shape
//! `win::text_input::win_text_input_layout` / `tui::text_input::
//! tui_text_input_layout` already use) and hands both to `paint` through
//! `MacBackend`'s own [`crate::paint_surface::PaintSurface`]
//! implementation.
//!
//! See `primitives::text_input`'s own `native_surface_paint` module doc for
//! why this reaches for the shared `PaintSurface` painter instead of a
//! fourth bespoke per-backend rasteriser (GTK/Windows/TUI each already
//! have a working, already-tested one of their own).

use crate::event::Rect;
use crate::primitives::text_input::{TextInput, TextInputLayout, TextInputMeasure};

/// Compute [`TextInputLayout`] for `ti` painted at `rect`, using the
/// backend's tracked `line_height`/`char_width` — what
/// [`crate::macos::backend::MacBackend::text_input_layout`] and
/// [`crate::macos::backend::MacBackend::draw_text_input`] both call.
/// Delegates entirely to [`TextInput::layout`] — no geometry re-derived
/// here, matching every other backend's `*_text_input_layout` wrapper.
pub fn mac_text_input_layout(
    ti: &TextInput,
    rect: Rect,
    line_height: f32,
    char_width: f32,
) -> TextInputLayout {
    ti.layout(rect, TextInputMeasure::new(line_height, char_width))
}