struct
Tessell::Layout::LayoutNode
- Tessell::Layout::LayoutNode
- Struct
- Value
- Object
Overview
布局节点(纯数据,可嵌套)。children 为 Array 缓冲:
TODO M1-WP5 复用/零分配——稳态热路径应复用预分配缓冲而非每帧 new。
Defined in:
tessell/layout.crConstructors
Instance Method Summary
- #children : Array(LayoutNode)
- #direction : Direction
- #font_id : Int32
- #font_size : Float32
-
#gap : Float32
主轴子项间距(issue #5);gap 计入容器 intrinsic 与 arrange 游标推进。
- #height : Dimension
- #id : String
- #margin : Insets
-
#measured : Size | Nil
可选测量缓存字段(纯函数路径不写入;由外层 retained 树按失效策略填充)。
- #padding : Insets
-
#text : String
文本叶子度量输入(仅当注入 Measurer 时使用;默认空串/0,不改变既有 Auto 叶子行为)。
- #vertical? : Bool
- #width : Dimension
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)
#