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§

source

fn get_x_offset(component_width: XCoord, available_width: XCoord) -> XCoord

source

fn get_y_offset(component_height: YCoord, available_height: YCoord) -> YCoord

Provided Methods§

source

fn map_x( original: XCoord, component_width: XCoord, available_width: XCoord ) -> GfxResult<XCoord>

source

fn reverse_map_x( resulting: XCoord, component_width: XCoord, available_width: XCoord ) -> XCoord

source

fn map_y( original: YCoord, component_height: YCoord, available_height: YCoord ) -> GfxResult<YCoord>

source

fn reverse_map_y( resulting: XCoord, component_height: YCoord, available_height: YCoord ) -> YCoord

Object Safety§

This trait is not object safe.

Implementors§