Documentation
¶
Overview ¶
Package yoga is a Go binding for the Yoga layout engine.
Index ¶
- Variables
- func FloatIsUndefined(value float32) bool
- func If[T any](expr bool, a, b T) T
- func IsInf(f float32, sign int) bool
- func IsNaN(f float32) (is bool)
- type Align
- type BaselineFunc
- type BoxSizing
- type Config
- func (c *Config) Destroy()
- func (c *Config) GetErrata() Errata
- func (c *Config) GetLogger() Logger
- func (c *Config) IsExperimentalFeatureEnabled(feature ExperimentalFeature) bool
- func (c *Config) PointScaleFactor() float32
- func (c *Config) SetErrata(errata Errata)
- func (c *Config) SetExperimentalFeatureEnabled(feature ExperimentalFeature, enabled bool)
- func (c *Config) SetLogger(logger Logger)
- func (c *Config) SetPointScaleFactor(pixelsInPoint float32)
- func (c *Config) SetUseWebDefaults(useWebDefaults bool)
- func (c *Config) UnsetLogger()
- func (c *Config) UseWebDefaults() bool
- type ConfigContext
- type Dimension
- type Direction
- type DirtiedFunc
- type Display
- type Edge
- type Errata
- type ExperimentalFeature
- type FlexDirection
- type Gutter
- type Justify
- type Layout
- type LogLevel
- type Logger
- type MeasureFunc
- type MeasureMode
- type Node
- func (n *Node) CalculateLayout(width, height float32, direction Direction)
- func (n *Node) Clone() *Node
- func (n *Node) CopyStyle(other *Node)
- func (n *Node) Destroy()
- func (n *Node) Finalize()
- func (n *Node) Free()
- func (n *Node) FreeRecursive()
- func (n *Node) GetAlignContent() Align
- func (n *Node) GetAlignItems() Align
- func (n *Node) GetAlignSelf() Align
- func (n *Node) GetAlwaysFormsContainingBlock() bool
- func (n *Node) GetAspectRatio() float32
- func (n *Node) GetBorder(edge Edge) float32
- func (n *Node) GetBoxSizing() BoxSizing
- func (n *Node) GetChild(index uint32) *Node
- func (n *Node) GetChildCount() uint32
- func (n *Node) GetComputedBorder(edge Edge) float32
- func (n *Node) GetComputedBottom() float32
- func (n *Node) GetComputedHeight() float32
- func (n *Node) GetComputedLayout() Layout
- func (n *Node) GetComputedLeft() float32
- func (n *Node) GetComputedMargin(edge Edge) float32
- func (n *Node) GetComputedPadding(edge Edge) float32
- func (n *Node) GetComputedRight() float32
- func (n *Node) GetComputedTop() float32
- func (n *Node) GetComputedWidth() float32
- func (n *Node) GetConfig() *Config
- func (n *Node) GetContext() interface{}
- func (n *Node) GetDirection() Direction
- func (n *Node) GetDirtiedFunc() DirtiedFunc
- func (n *Node) GetDisplay() Display
- func (n *Node) GetFlex() float32
- func (n *Node) GetFlexBasis() Value
- func (n *Node) GetFlexDirection() FlexDirection
- func (n *Node) GetFlexGrow() float32
- func (n *Node) GetFlexShrink() float32
- func (n *Node) GetFlexWrap() Wrap
- func (n *Node) GetGap(gutter Gutter) Value
- func (n *Node) GetHeight() Value
- func (n *Node) GetJustifyContent() Justify
- func (n *Node) GetLayoutDirection() Direction
- func (n *Node) GetMargin(edge Edge) Value
- func (n *Node) GetMaxHeight() Value
- func (n *Node) GetMaxWidth() Value
- func (n *Node) GetMeasureFunc() MeasureFunc
- func (n *Node) GetMinHeight() Value
- func (n *Node) GetMinWidth() Value
- func (n *Node) GetNodeType() NodeType
- func (n *Node) GetOverflow() Overflow
- func (n *Node) GetOwner() *Node
- func (n *Node) GetPadding(edge Edge) Value
- func (n *Node) GetParent() *Node
- func (n *Node) GetPosition(edge Edge) Value
- func (n *Node) GetPositionType() PositionType
- func (n *Node) GetRawHeight() float32
- func (n *Node) GetRawWidth() float32
- func (n *Node) GetWidth() Value
- func (n *Node) HadOverflow() bool
- func (n *Node) HasBaselineFunc() bool
- func (n *Node) HasNewLayout() bool
- func (n *Node) InsertChild(child *Node, index uint32)
- func (n *Node) IsDirty() bool
- func (n *Node) IsReferenceBaseline() bool
- func (n *Node) MarkDirty()
- func (n *Node) RemoveAllChildren()
- func (n *Node) RemoveChild(child *Node)
- func (n *Node) Reset()
- func (n *Node) SetAlignContent(alignContent Align)
- func (n *Node) SetAlignItems(alignItems Align)
- func (n *Node) SetAlignSelf(alignSelf Align)
- func (n *Node) SetAlwaysFormsContainingBlock(alwaysFormsContainingBlock bool)
- func (n *Node) SetAspectRatio(aspectRatio float32)
- func (n *Node) SetBaselineFunc(baselineFunc BaselineFunc)
- func (n *Node) SetBorder(edge Edge, border float32)
- func (n *Node) SetBoxSizing(boxSizing BoxSizing)
- func (n *Node) SetChildren(children *Node, count uint32)
- func (n *Node) SetConfig(config *Config)
- func (n *Node) SetContext(context interface{})
- func (n *Node) SetDirection(direction Direction)
- func (n *Node) SetDirtiedFunc(dirtiedFunc DirtiedFunc)
- func (n *Node) SetDisplay(display Display)
- func (n *Node) SetFlex(flex float32)
- func (n *Node) SetFlexBasis(flexBasis float32)
- func (n *Node) SetFlexBasisAuto()
- func (n *Node) SetFlexBasisFitContent()
- func (n *Node) SetFlexBasisMaxContent()
- func (n *Node) SetFlexBasisPercent(flexBasis float32)
- func (n *Node) SetFlexBasisStretch()
- func (n *Node) SetFlexDirection(flexDirection FlexDirection)
- func (n *Node) SetFlexGrow(flexGrow float32)
- func (n *Node) SetFlexShrink(flexShrink float32)
- func (n *Node) SetFlexWrap(flexWrap Wrap)
- func (n *Node) SetGap(gutter Gutter, gapLength float32)
- func (n *Node) SetGapPercent(gutter Gutter, gapLength float32)
- func (n *Node) SetHasNewLayout(hasNewLayout bool)
- func (n *Node) SetHeight(height float32)
- func (n *Node) SetHeightAuto()
- func (n *Node) SetHeightFitContent()
- func (n *Node) SetHeightMaxContent()
- func (n *Node) SetHeightPercent(height float32)
- func (n *Node) SetHeightStretch()
- func (n *Node) SetIsReferenceBaseline(isReferenceBaseline bool)
- func (n *Node) SetJustifyContent(justifyContent Justify)
- func (n *Node) SetMargin(edge Edge, margin float32)
- func (n *Node) SetMarginAuto(edge Edge)
- func (n *Node) SetMarginPercent(edge Edge, margin float32)
- func (n *Node) SetMaxHeight(maxHeight float32)
- func (n *Node) SetMaxHeightFitContent()
- func (n *Node) SetMaxHeightMaxContent()
- func (n *Node) SetMaxHeightPercent(maxHeight float32)
- func (n *Node) SetMaxHeightStretch()
- func (n *Node) SetMaxWidth(maxWidth float32)
- func (n *Node) SetMaxWidthFitContent()
- func (n *Node) SetMaxWidthMaxContent()
- func (n *Node) SetMaxWidthPercent(maxWidth float32)
- func (n *Node) SetMaxWidthStretch()
- func (n *Node) SetMeasureFunc(measureFunc MeasureFunc)
- func (n *Node) SetMinHeight(minHeight float32)
- func (n *Node) SetMinHeightFitContent()
- func (n *Node) SetMinHeightMaxContent()
- func (n *Node) SetMinHeightPercent(minHeight float32)
- func (n *Node) SetMinHeightStretch()
- func (n *Node) SetMinWidth(minWidth float32)
- func (n *Node) SetMinWidthFitContent()
- func (n *Node) SetMinWidthMaxContent()
- func (n *Node) SetMinWidthPercent(minWidth float32)
- func (n *Node) SetMinWidthStretch()
- func (n *Node) SetNodeType(nodeType NodeType)
- func (n *Node) SetOverflow(overflow Overflow)
- func (n *Node) SetPadding(edge Edge, padding float32)
- func (n *Node) SetPaddingPercent(edge Edge, padding float32)
- func (n *Node) SetPosition(edge Edge, position float32)
- func (n *Node) SetPositionAuto(edge Edge)
- func (n *Node) SetPositionPercent(edge Edge, position float32)
- func (n *Node) SetPositionType(positionType PositionType)
- func (n *Node) SetWidth(width float32)
- func (n *Node) SetWidthAuto()
- func (n *Node) SetWidthFitContent()
- func (n *Node) SetWidthMaxContent()
- func (n *Node) SetWidthPercent(width float32)
- func (n *Node) SetWidthStretch()
- func (n *Node) SwapChild(child *Node, index uint32)
- func (n *Node) ToYogaLayout() string
- func (n *Node) UnsetDirtiedFunc()
- func (n *Node) UnsetMeasureFunc()
- type NodeContext
- type NodeType
- type Overflow
- type PositionType
- type Size
- type Unit
- type Value
- type Wrap
Constants ¶
This section is empty.
Variables ¶
var ( NaN = math.Float32frombits(uvnan) Undefined float32 = NaN Zero float32 = 0.0 )
Functions ¶
func FloatIsUndefined ¶
FloatIsUndefined reports whether a float value represents undefined.
Types ¶
type Align ¶
type Align int
Align represents the enum type for Align
func AlignFromString ¶
AlignFromString parses Align enum value from string
type BaselineFunc ¶
BaselineFunc defines the type for the baseline callback function
type BoxSizing ¶
type BoxSizing int
BoxSizing represents the enum type for BoxSizing
func BoxSizingFromString ¶
BoxSizingFromString parses BoxSizing enum value from string
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config 包装YGConfigRef
func (*Config) IsExperimentalFeatureEnabled ¶
func (c *Config) IsExperimentalFeatureEnabled(feature ExperimentalFeature) bool
IsExperimentalFeatureEnabled 检查实验性功能是否启用
func (*Config) PointScaleFactor ¶
PointScaleFactor 获取点缩放因子
func (*Config) SetExperimentalFeatureEnabled ¶
func (c *Config) SetExperimentalFeatureEnabled(feature ExperimentalFeature, enabled bool)
SetExperimentalFeatureEnabled 启用或禁用实验性功能
func (*Config) SetPointScaleFactor ¶
SetPointScaleFactor 设置点缩放因子
func (*Config) SetUseWebDefaults ¶
SetUseWebDefaults 设置是否使用Web默认值
type ConfigContext ¶
type ConfigContext struct {
// contains filtered or unexported fields
}
ConfigContext 存储 Config 的回调句柄,类似于 NodeContext
type Dimension ¶
type Dimension int
Dimension represents the enum type for Dimension
func DimensionFromString ¶
DimensionFromString parses Dimension enum value from string
type Direction ¶
type Direction int
Direction represents the enum type for Direction
func DirectionFromString ¶
DirectionFromString parses Direction enum value from string
type Display ¶
type Display int
Display represents the enum type for Display
func DisplayFromString ¶
DisplayFromString parses Display enum value from string
type Edge ¶
type Edge int
Edge represents the enum type for Edge
func EdgeFromString ¶
EdgeFromString parses Edge enum value from string
type Errata ¶
type Errata uint32
Errata represents the enum type for Errata
func ErrataFromString ¶
ErrataFromString parses Errata enum value from string
type ExperimentalFeature ¶
type ExperimentalFeature int
ExperimentalFeature represents the enum type for ExperimentalFeature
const (
ExperimentalFeatureWebFlexBasis ExperimentalFeature = iota
)
func ExperimentalFeatureFromString ¶
func ExperimentalFeatureFromString(s string) (ExperimentalFeature, error)
ExperimentalFeatureFromString parses ExperimentalFeature enum value from string
func (ExperimentalFeature) String ¶
func (e ExperimentalFeature) String() string
String returns the string representation of ExperimentalFeature
type FlexDirection ¶
type FlexDirection int
FlexDirection represents the enum type for FlexDirection
const ( FlexDirectionColumn FlexDirection = iota FlexDirectionColumnReverse FlexDirectionRow FlexDirectionRowReverse )
func FlexDirectionFromString ¶
func FlexDirectionFromString(s string) (FlexDirection, error)
FlexDirectionFromString parses FlexDirection enum value from string
func (FlexDirection) String ¶
func (e FlexDirection) String() string
String returns the string representation of FlexDirection
type Gutter ¶
type Gutter int
Gutter represents the enum type for Gutter
func GutterFromString ¶
GutterFromString parses Gutter enum value from string
type Justify ¶
type Justify int
Justify represents the enum type for Justify
func JustifyFromString ¶
JustifyFromString parses Justify enum value from string
type Layout ¶
type Layout struct {
Left float32
Right float32
Top float32
Bottom float32
Width float32
Height float32
}
Layout represents the computed layout information
type LogLevel ¶
type LogLevel int
LogLevel represents the enum type for LogLevel
func LogLevelFromString ¶
LogLevelFromString parses LogLevel enum value from string
type MeasureFunc ¶
type MeasureFunc func(width float32, widthMode MeasureMode, height float32, heightMode MeasureMode) Size
MeasureFunc defines the type for the measurement callback function
type MeasureMode ¶
type MeasureMode int
MeasureMode represents the enum type for MeasureMode
const ( MeasureModeUndefined MeasureMode = iota MeasureModeExactly MeasureModeAtMost )
func MeasureModeFromString ¶
func MeasureModeFromString(s string) (MeasureMode, error)
MeasureModeFromString parses MeasureMode enum value from string
func (MeasureMode) String ¶
func (e MeasureMode) String() string
String returns the string representation of MeasureMode
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewNodeWithConfig ¶
NewNodeWithConfig creates a node with the specified configuration
func (*Node) CalculateLayout ¶
CalculateLayout calculates the layout
func (*Node) Clone ¶
Clone creates a copy of the node with the same context and children, but no owner set
func (*Node) Finalize ¶
func (n *Node) Finalize()
Finalize frees the node without disconnecting it from its owner or children
func (*Node) Free ¶
func (n *Node) Free()
Free Frees the Yoga node without disconnecting it from its owner or children. Allows garbage collecting Yoga nodes in parallel when the entire tree is unreachable.
func (*Node) FreeRecursive ¶
func (n *Node) FreeRecursive()
FreeRecursive frees the node and all its children recursively
func (*Node) GetAlignContent ¶
GetAlignContent gets the alignment of content
func (*Node) GetAlignItems ¶
GetAlignItems gets the alignment of child items
func (*Node) GetAlignSelf ¶
GetAlignSelf gets the alignment for the node itself
func (*Node) GetAlwaysFormsContainingBlock ¶
GetAlwaysFormsContainingBlock checks if the node always forms a containing block
func (*Node) GetAspectRatio ¶
GetAspectRatio gets the aspect ratio
func (*Node) GetBoxSizing ¶
GetBoxSizing gets the box model type
func (*Node) GetChildCount ¶
GetChildCount gets the number of child nodes
func (*Node) GetComputedBorder ¶
GetComputedBorder gets the computed border width
func (*Node) GetComputedBottom ¶
GetComputedBottom gets the computed bottom position
func (*Node) GetComputedHeight ¶
GetComputedHeight gets the computed height
func (*Node) GetComputedLayout ¶
GetComputedLayout gets the complete computed layout
func (*Node) GetComputedLeft ¶
GetComputedLeft gets the computed left position
func (*Node) GetComputedMargin ¶
GetComputedMargin gets the computed margin
func (*Node) GetComputedPadding ¶
GetComputedPadding gets the computed padding
func (*Node) GetComputedRight ¶
GetComputedRight gets the computed right position
func (*Node) GetComputedTop ¶
GetComputedTop gets the computed top position
func (*Node) GetComputedWidth ¶
GetComputedWidth gets the computed width
func (*Node) GetContext ¶
func (n *Node) GetContext() interface{}
GetContext gets the context of the node
func (*Node) GetDirection ¶
GetDirection gets the document flow direction
func (*Node) GetDirtiedFunc ¶
func (n *Node) GetDirtiedFunc() DirtiedFunc
GetDirtiedFunc gets the current dirtied callback function
func (*Node) GetFlexBasis ¶
GetFlexBasis gets the flex basis size
func (*Node) GetFlexDirection ¶
func (n *Node) GetFlexDirection() FlexDirection
GetFlexDirection gets the flex direction
func (*Node) GetFlexGrow ¶
GetFlexGrow gets the flex grow factor
func (*Node) GetFlexShrink ¶
GetFlexShrink gets the flex shrink factor
func (*Node) GetJustifyContent ¶
GetJustifyContent gets the alignment along the main axis
func (*Node) GetLayoutDirection ¶
GetLayoutDirection gets the layout direction after layout calculation
func (*Node) GetMaxHeight ¶
GetMaxHeight gets the maximum height
func (*Node) GetMeasureFunc ¶
func (n *Node) GetMeasureFunc() MeasureFunc
GetMeasureFunc gets the current measurement callback function
func (*Node) GetMinHeight ¶
GetMinHeight gets the minimum height
func (*Node) GetNodeType ¶
GetNodeType gets the type of the node
func (*Node) GetOverflow ¶
GetOverflow gets the overflow behavior
func (*Node) GetPosition ¶
GetPosition gets the position value
func (*Node) GetPositionType ¶
func (n *Node) GetPositionType() PositionType
GetPositionType gets the position type
func (*Node) GetRawHeight ¶
GetRawHeight gets the measured height before layout rounding
func (*Node) GetRawWidth ¶
GetRawWidth gets the measured width before layout rounding
func (*Node) HadOverflow ¶
HadOverflow checks if the node had overflow
func (*Node) HasBaselineFunc ¶
HasBaselineFunc checks if a baseline function is set
func (*Node) HasNewLayout ¶
HasNewLayout checks if the node has a new layout
func (*Node) InsertChild ¶
InsertChild inserts a child node at the specified position
func (*Node) IsReferenceBaseline ¶
IsReferenceBaseline checks if the node is a reference baseline
func (*Node) MarkDirty ¶
func (n *Node) MarkDirty()
MarkDirty marks the node as dirty (needs recalculation)
func (*Node) RemoveAllChildren ¶
func (n *Node) RemoveAllChildren()
RemoveAllChildren removes all child nodes from the node
func (*Node) SetAlignContent ¶
SetAlignContent sets the alignment of content
func (*Node) SetAlignItems ¶
SetAlignItems sets the alignment of child items
func (*Node) SetAlignSelf ¶
SetAlignSelf sets the alignment for the node itself
func (*Node) SetAlwaysFormsContainingBlock ¶
SetAlwaysFormsContainingBlock sets whether the node always forms a containing block
func (*Node) SetAspectRatio ¶
SetAspectRatio sets the aspect ratio
func (*Node) SetBaselineFunc ¶
func (n *Node) SetBaselineFunc(baselineFunc BaselineFunc)
SetBaselineFunc sets the baseline function
func (*Node) SetBoxSizing ¶
SetBoxSizing sets the box model type
func (*Node) SetChildren ¶
SetChildren sets children according to the given list of nodes.
func (*Node) SetContext ¶
func (n *Node) SetContext(context interface{})
SetContext sets the context for the node
func (*Node) SetDirection ¶
SetDirection sets the document flow direction
func (*Node) SetDirtiedFunc ¶
func (n *Node) SetDirtiedFunc(dirtiedFunc DirtiedFunc)
SetDirtiedFunc sets the dirtied callback function
func (*Node) SetDisplay ¶
SetDisplay sets the display behavior
func (*Node) SetFlexBasis ¶
SetFlexBasis sets the flex basis size
func (*Node) SetFlexBasisAuto ¶
func (n *Node) SetFlexBasisAuto()
SetFlexBasisAuto sets the flex basis size to auto
func (*Node) SetFlexBasisFitContent ¶
func (n *Node) SetFlexBasisFitContent()
SetFlexBasisFitContent sets the flex basis to fit-content
func (*Node) SetFlexBasisMaxContent ¶
func (n *Node) SetFlexBasisMaxContent()
SetFlexBasisMaxContent sets the flex basis to max-content
func (*Node) SetFlexBasisPercent ¶
SetFlexBasisPercent sets the flex basis size in percentage
func (*Node) SetFlexBasisStretch ¶
func (n *Node) SetFlexBasisStretch()
SetFlexBasisStretch sets the flex basis to stretch
func (*Node) SetFlexDirection ¶
func (n *Node) SetFlexDirection(flexDirection FlexDirection)
SetFlexDirection sets the flex direction
func (*Node) SetFlexGrow ¶
SetFlexGrow sets the flex grow factor
func (*Node) SetFlexShrink ¶
SetFlexShrink sets the flex shrink factor
func (*Node) SetFlexWrap ¶
SetFlexWrap sets the wrapping behavior
func (*Node) SetGapPercent ¶
SetGapPercent sets the gap in percentage
func (*Node) SetHasNewLayout ¶
SetHasNewLayout marks the layout as seen
func (*Node) SetHeightFitContent ¶
func (n *Node) SetHeightFitContent()
SetHeightFitContent sets the height to fit-content
func (*Node) SetHeightMaxContent ¶
func (n *Node) SetHeightMaxContent()
SetHeightMaxContent sets the height to max-content
func (*Node) SetHeightPercent ¶
SetHeightPercent sets the height in percentage
func (*Node) SetHeightStretch ¶
func (n *Node) SetHeightStretch()
SetHeightStretch sets the height to stretch
func (*Node) SetIsReferenceBaseline ¶
SetIsReferenceBaseline sets whether the node is a reference baseline
func (*Node) SetJustifyContent ¶
SetJustifyContent sets the alignment along the main axis
func (*Node) SetMarginAuto ¶
SetMarginAuto sets the margin to auto
func (*Node) SetMarginPercent ¶
SetMarginPercent sets the margin in percentage
func (*Node) SetMaxHeight ¶
SetMaxHeight sets the maximum height
func (*Node) SetMaxHeightFitContent ¶
func (n *Node) SetMaxHeightFitContent()
SetMaxHeightFitContent sets the maximum height to fit-content
func (*Node) SetMaxHeightMaxContent ¶
func (n *Node) SetMaxHeightMaxContent()
SetMaxHeightMaxContent sets the maximum height to max-content
func (*Node) SetMaxHeightPercent ¶
SetMaxHeightPercent sets the maximum height in percentage
func (*Node) SetMaxHeightStretch ¶
func (n *Node) SetMaxHeightStretch()
SetMaxHeightStretch sets the maximum height to stretch
func (*Node) SetMaxWidth ¶
SetMaxWidth sets the maximum width
func (*Node) SetMaxWidthFitContent ¶
func (n *Node) SetMaxWidthFitContent()
SetMaxWidthFitContent sets the maximum width to fit-content
func (*Node) SetMaxWidthMaxContent ¶
func (n *Node) SetMaxWidthMaxContent()
SetMaxWidthMaxContent sets the maximum width to max-content
func (*Node) SetMaxWidthPercent ¶
SetMaxWidthPercent sets the maximum width in percentage
func (*Node) SetMaxWidthStretch ¶
func (n *Node) SetMaxWidthStretch()
SetMaxWidthStretch sets the maximum width to stretch
func (*Node) SetMeasureFunc ¶
func (n *Node) SetMeasureFunc(measureFunc MeasureFunc)
SetMeasureFunc sets the measurement function
func (*Node) SetMinHeight ¶
SetMinHeight sets the minimum height
func (*Node) SetMinHeightFitContent ¶
func (n *Node) SetMinHeightFitContent()
SetMinHeightFitContent sets the minimum height to fit-content
func (*Node) SetMinHeightMaxContent ¶
func (n *Node) SetMinHeightMaxContent()
SetMinHeightMaxContent sets the minimum height to max-content
func (*Node) SetMinHeightPercent ¶
SetMinHeightPercent sets the minimum height in percentage
func (*Node) SetMinHeightStretch ¶
func (n *Node) SetMinHeightStretch()
SetMinHeightStretch sets the minimum height to stretch
func (*Node) SetMinWidth ¶
SetMinWidth sets the minimum width
func (*Node) SetMinWidthFitContent ¶
func (n *Node) SetMinWidthFitContent()
SetMinWidthFitContent sets the minimum width to fit-content
func (*Node) SetMinWidthMaxContent ¶
func (n *Node) SetMinWidthMaxContent()
SetMinWidthMaxContent sets the minimum width to max-content
func (*Node) SetMinWidthPercent ¶
SetMinWidthPercent sets the minimum width in percentage
func (*Node) SetMinWidthStretch ¶
func (n *Node) SetMinWidthStretch()
SetMinWidthStretch sets the minimum width to stretch
func (*Node) SetNodeType ¶
SetNodeType Sets whether a leaf node's layout results may be truncated during layout rounding.
func (*Node) SetOverflow ¶
SetOverflow sets the overflow behavior
func (*Node) SetPadding ¶
SetPadding sets the padding
func (*Node) SetPaddingPercent ¶
SetPaddingPercent sets the padding in percentage
func (*Node) SetPosition ¶
SetPosition sets the position
func (*Node) SetPositionAuto ¶
SetPositionAuto sets the position to auto
func (*Node) SetPositionPercent ¶
SetPositionPercent sets the position in percentage
func (*Node) SetPositionType ¶
func (n *Node) SetPositionType(positionType PositionType)
SetPositionType sets the position type
func (*Node) SetWidthFitContent ¶
func (n *Node) SetWidthFitContent()
SetWidthFitContent sets the width to fit-content
func (*Node) SetWidthMaxContent ¶
func (n *Node) SetWidthMaxContent()
SetWidthMaxContent sets the width to max-content
func (*Node) SetWidthPercent ¶
SetWidthPercent sets the width in percentage
func (*Node) SetWidthStretch ¶
func (n *Node) SetWidthStretch()
SetWidthStretch sets the width to stretch
func (*Node) ToYogaLayout ¶
ToYogaLayout generates a JSX representation of the node tree compatible with yogalayout.dev playground
func (*Node) UnsetDirtiedFunc ¶
func (n *Node) UnsetDirtiedFunc()
UnsetDirtiedFunc unsets the dirtied callback function
func (*Node) UnsetMeasureFunc ¶
func (n *Node) UnsetMeasureFunc()
UnsetMeasureFunc unsets the measurement function
type NodeContext ¶
type NodeContext struct {
// contains filtered or unexported fields
}
NodeContext 存储节点的回调句柄,避免全局 map 查找
type NodeType ¶
type NodeType int
NodeType represents the enum type for NodeType
func NodeTypeFromString ¶
NodeTypeFromString parses NodeType enum value from string
type Overflow ¶
type Overflow int
Overflow represents the enum type for Overflow
func OverflowFromString ¶
OverflowFromString parses Overflow enum value from string
type PositionType ¶
type PositionType int
PositionType represents the enum type for PositionType
const ( PositionTypeStatic PositionType = iota PositionTypeRelative PositionTypeAbsolute )
func PositionTypeFromString ¶
func PositionTypeFromString(s string) (PositionType, error)
PositionTypeFromString parses PositionType enum value from string
func (PositionType) String ¶
func (e PositionType) String() string
String returns the string representation of PositionType
type Unit ¶
type Unit int
Unit represents the enum type for Unit
func UnitFromString ¶
UnitFromString parses Unit enum value from string
type Wrap ¶
type Wrap int
Wrap represents the enum type for Wrap
func WrapFromString ¶
WrapFromString parses Wrap enum value from string