pub trait MacroDefinedLayout {
// Required methods
fn rect(&self) -> Rect;
fn size_rules(&mut self, cx: &mut SizeCx<'_>, axis: AxisInfo) -> SizeRules;
fn set_rect(&mut self, cx: &mut SizeCx<'_>, rect: Rect, hints: AlignHints);
fn draw(&self, draw: DrawCx<'_>);
}Expand description
Macro-defined layout
This trait is a copy of Layout, implemented by the
#[layout] macro. In some cases it is useful to
invoke kas::MacroDefinedLayout::set_rect (or other method) from the
corresponding Layout method to perform some other action before using
the default implementation.
[#[layout]]: kas::layout
Required Methods§
Sourcefn size_rules(&mut self, cx: &mut SizeCx<'_>, axis: AxisInfo) -> SizeRules
fn size_rules(&mut self, cx: &mut SizeCx<'_>, axis: AxisInfo) -> SizeRules
Get size rules for the given axis
Sourcefn set_rect(&mut self, cx: &mut SizeCx<'_>, rect: Rect, hints: AlignHints)
fn set_rect(&mut self, cx: &mut SizeCx<'_>, rect: Rect, hints: AlignHints)
Set size and position