Trait avrox_display::gfx::primitives::Position
source · pub trait Position {
// Required methods
fn get_x_offset(component_width: XCoord, available_width: XCoord) -> XCoord;
fn get_y_offset(
component_height: YCoord,
available_height: YCoord
) -> YCoord;
// Provided methods
fn map_x(
original: XCoord,
component_width: XCoord,
available_width: XCoord
) -> GfxResult<XCoord> { ... }
fn reverse_map_x(
resulting: XCoord,
component_width: XCoord,
available_width: XCoord
) -> XCoord { ... }
fn map_y(
original: YCoord,
component_height: YCoord,
available_height: YCoord
) -> GfxResult<YCoord> { ... }
fn reverse_map_y(
resulting: XCoord,
component_height: YCoord,
available_height: YCoord
) -> YCoord { ... }
}
Expand description
A trait for positioning classes, that allow us to tell a component to align (left/centre/right or top/middle/bottom) within a space.
Required Methods§
fn get_x_offset(component_width: XCoord, available_width: XCoord) -> XCoord
fn get_y_offset(component_height: YCoord, available_height: YCoord) -> YCoord
Provided Methods§
fn map_x( original: XCoord, component_width: XCoord, available_width: XCoord ) -> GfxResult<XCoord>
fn reverse_map_x( resulting: XCoord, component_width: XCoord, available_width: XCoord ) -> XCoord
fn map_y( original: YCoord, component_height: YCoord, available_height: YCoord ) -> GfxResult<YCoord>
fn reverse_map_y( resulting: XCoord, component_height: YCoord, available_height: YCoord ) -> YCoord
Object Safety§
This trait is not object safe.