Skip to main content

RenderAligningShiftedBox

Trait RenderAligningShiftedBox 

Source
pub trait RenderAligningShiftedBox: RenderShiftedBox {
    // Required methods
    fn aligning_data(
        self: RenderHandle<Self>,
        app: &App,
    ) -> &RenderAligningShiftedBoxData;
    fn aligning_data_mut(
        self: RenderHandle<Self>,
        app: &mut App,
    ) -> &mut RenderAligningShiftedBoxData;

    // Provided methods
    fn resolved_alignment(self: RenderHandle<Self>, app: &mut App) -> Alignment { ... }
    fn mark_need_resolution(self: RenderHandle<Self>, app: &mut App) { ... }
    fn alignment(self: RenderHandle<Self>, app: &App) -> AlignmentGeometry { ... }
    fn set_alignment(
        self: RenderHandle<Self>,
        app: &mut App,
        value: AlignmentGeometry,
    ) { ... }
    fn text_direction(
        self: RenderHandle<Self>,
        app: &App,
    ) -> Option<TextDirection> { ... }
    fn set_text_direction(
        self: RenderHandle<Self>,
        app: &mut App,
        value: Option<TextDirection>,
    ) { ... }
    fn align_child(self: RenderHandle<Self>, app: &mut App) { ... }
}
Expand description

Abstract class for one-child-layout render boxes that use a AlignmentGeometry to align their children.

Required Methods§

Source

fn aligning_data( self: RenderHandle<Self>, app: &App, ) -> &RenderAligningShiftedBoxData

Mixin field access.

Source

fn aligning_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderAligningShiftedBoxData

Provided Methods§

Source

fn resolved_alignment(self: RenderHandle<Self>, app: &mut App) -> Alignment

The alignment resolved against text_direction.

Source

fn mark_need_resolution(self: RenderHandle<Self>, app: &mut App)

Source

fn alignment(self: RenderHandle<Self>, app: &App) -> AlignmentGeometry

How to align the child.

The x and y values of the alignment control the horizontal and vertical alignment, respectively. An x value of -1.0 means that the left edge of the child is aligned with the left edge of the parent whereas an x value of 1.0 means that the right edge of the child is aligned with the right edge of the parent. Other values interpolate (and extrapolate) linearly.

Source

fn set_alignment( self: RenderHandle<Self>, app: &mut App, value: AlignmentGeometry, )

Sets alignment.

Source

fn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>

The text direction with which to resolve alignment.

Source

fn set_text_direction( self: RenderHandle<Self>, app: &mut App, value: Option<TextDirection>, )

Source

fn align_child(self: RenderHandle<Self>, app: &mut App)

Apply the current alignment to the child.

Subclasses should call this method if they have a child, to have this class perform the actual alignment. If they don’t have a child, they should not call this method.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§