pub struct LayoutExtras<'a> {
pub aspect_ratio: f32,
pub grid_col_span: u8,
pub grid_template_fr: &'a [u16],
pub sticky_top: Option<i16>,
pub rtl: bool,
pub scroll_chaining: bool,
}Expand description
按需分配于 ScratchArena 的 Div 高级渲染特效包(多色标渐变、独立圆角、混合模式、滤镜、2D 变换、路径裁剪与外部零拷贝纹理)。
冷路径高级布局扩展(按需挂接于 PaintEffects::layout_ext,常规节点 0 字节占用):
支持 aspect-ratio 纵横比、CSS Grid 跨列与 fr 列权重、position: sticky 吸顶、RTL 镜像与嵌套滚动链。
Fields§
§aspect_ratio: f32纵横比约束 width / height(如 16.0 / 9.0,<= 0.0 表示关闭)。
grid_col_span: u8CSS Grid 子项跨列数(默认 1)。
grid_template_fr: &'a [u16]CSS Grid 自定义列权重数组(如 &[1, 2, 1] 对应 1fr 2fr 1fr)。
sticky_top: Option<i16>position: sticky 相对最近滚动视口顶部的吸顶偏移(None 表示普通流式排布)。
rtl: boolRTL 布局镜像(FlexDir::Row 自动水平从右向左排布子元素)。
scroll_chaining: bool嵌套滚动链:内层滚动触顶/触底时是否继续向上冒泡给外层滚动容器(默认 true)。
Implementations§
Trait Implementations§
Source§impl<'a> Clone for LayoutExtras<'a>
impl<'a> Clone for LayoutExtras<'a>
impl<'a> Copy for LayoutExtras<'a>
Auto Trait Implementations§
impl<'a> Forget for LayoutExtras<'a>
impl<'a> Freeze for LayoutExtras<'a>
impl<'a> Move for LayoutExtras<'a>
impl<'a> RefUnwindSafe for LayoutExtras<'a>
impl<'a> Send for LayoutExtras<'a>
impl<'a> Sync for LayoutExtras<'a>
impl<'a> Unpin for LayoutExtras<'a>
impl<'a> UnsafeUnpin for LayoutExtras<'a>
impl<'a> UnwindSafe for LayoutExtras<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。