Documentation ¶
Overview ¶
Layout related types and utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
type Constraint struct {
MinSize, MaxSize geometry.Size
ParentSize geometry.Size
RootSize geometry.Size
}
Constraint define layout constraint.
func (Constraint) ApplyOnHeight ¶
func (c Constraint) ApplyOnHeight(height int) int
ApplyOnHeight applies the height constraints on the given height and return the constrained height.
func (Constraint) ApplyOnSize ¶
func (c Constraint) ApplyOnSize(size geometry.Size) geometry.Size
ApplyOnSize applies the size constraints on the given size and return the constrained size.
func (Constraint) ApplyOnWidth ¶
func (c Constraint) ApplyOnWidth(width int) int
ApplyOnWidth applies the width constraints on the given width and return the constrained width.
func (Constraint) Equals ¶
func (c Constraint) Equals(other Constraint) bool
Equals returns true if the given Constraint is equal to this Constraint.
type Layout ¶
type Layout interface {
Layout(Constraint) geometry.Size
}
Layout is a generic interface for object that can produce BoxModel using the given Constraint.
type LayoutFunc ¶
type LayoutFunc func(Constraint) geometry.Size
func (LayoutFunc) Layout ¶
func (lf LayoutFunc) Layout(co Constraint) geometry.Size
Layout implements the Layout interface.
Click to show internal directories.
Click to hide internal directories.