PositioningAlgorithm

Trait PositioningAlgorithm 

Source
pub trait PositioningAlgorithm {
    // Required methods
    fn calculate_position(&self, child_position: Position) -> Position;
    fn set_parent_position(&mut self, position: Position);
}
Expand description
§Description

The interface for defining a positioning algorithm to determine the placement of widgets

Required Methods§

Source

fn calculate_position(&self, child_position: Position) -> Position

§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

Source

fn set_parent_position(&mut self, 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

Implementors§