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§
Sourcefn aligning_data(
self: RenderHandle<Self>,
app: &App,
) -> &RenderAligningShiftedBoxData
fn aligning_data( self: RenderHandle<Self>, app: &App, ) -> &RenderAligningShiftedBoxData
Mixin field access.
Sourcefn aligning_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderAligningShiftedBoxData
fn aligning_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderAligningShiftedBoxData
See aligning_data.
Provided Methods§
Sourcefn resolved_alignment(self: RenderHandle<Self>, app: &mut App) -> Alignment
fn resolved_alignment(self: RenderHandle<Self>, app: &mut App) -> Alignment
The alignment resolved against text_direction.
fn mark_need_resolution(self: RenderHandle<Self>, app: &mut App)
Sourcefn alignment(self: RenderHandle<Self>, app: &App) -> AlignmentGeometry
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.
Sourcefn set_alignment(
self: RenderHandle<Self>,
app: &mut App,
value: AlignmentGeometry,
)
fn set_alignment( self: RenderHandle<Self>, app: &mut App, value: AlignmentGeometry, )
Sets alignment.
Sourcefn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>
fn text_direction(self: RenderHandle<Self>, app: &App) -> Option<TextDirection>
The text direction with which to resolve alignment.
Sourcefn set_text_direction(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TextDirection>,
)
fn set_text_direction( self: RenderHandle<Self>, app: &mut App, value: Option<TextDirection>, )
Sets text_direction.
Sourcefn align_child(self: RenderHandle<Self>, app: &mut App)
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".