struct Tessell::Layout::LayoutNode

Overview

布局节点(纯数据,可嵌套)。children 为 Array 缓冲:

TODO M1-WP5 复用/零分配——稳态热路径应复用预分配缓冲而非每帧 new。

Defined in:

tessell/layout.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : String = "", width : Dimension = Auto.new, height : Dimension = Auto.new, padding : Insets = Insets.new, margin : Insets = Insets.new, direction : Direction = Direction::Vertical, gap : Float32 = 0.0_f32, children : Array(LayoutNode) = [] of LayoutNode, measured : Size | Nil = nil, text : String = "", font_id : Int32 = 0, font_size : Float32 = 0.0_f32) #

[View source]

Instance Method Detail

def children : Array(LayoutNode) #

[View source]
def direction : Direction #

[View source]
def font_id : Int32 #

[View source]
def font_size : Float32 #

[View source]
def gap : Float32 #

主轴子项间距(issue #5);gap 计入容器 intrinsic 与 arrange 游标推进。


[View source]
def height : Dimension #

[View source]
def id : String #

[View source]
def margin : Insets #

[View source]
def measured : Size | Nil #

可选测量缓存字段(纯函数路径不写入;由外层 retained 树按失效策略填充)。


[View source]
def padding : Insets #

[View source]
def text : String #

文本叶子度量输入(仅当注入 Measurer 时使用;默认空串/0,不改变既有 Auto 叶子行为)。


[View source]
def vertical? : Bool #

[View source]
def width : Dimension #

[View source]