fp_tui 0.2.2

A very basic tui library
Documentation
use super::common::Position;

/// #### Description
/// The interface for defining a positioning algorithm to determine the
/// placement of widgets
///
pub trait PositioningAlgorithm {
    /// #### Description
    /// Calculates the position of an element relative to the root widget
    ///
    /// #### Arguments
    /// * `child_position`: [Position] - The position of the child widget
    /// 
    /// #### Returns
    /// [Position] - The position of the element relative to the root widget
    ///
    fn calculate_position(&self, child_position: Position) -> Position;

    /// #### Description
    /// Updates the positioning algorithm on the absolute position of the
    /// parent element to ensure proper positioning
    /// 
    /// #### Arguments
    /// * `position`: [Position] - The absolute position of the parent widget
    /// 
    fn set_parent_position(&mut self, position: Position);
}