Documentation
¶
Index ¶
- type Block
- type BlockBox
- type Box
- type Dimensions
- type Edges
- type Inline
- func (box *Inline) AlignBottom(ybottom int)
- func (box *Inline) AlignTop(y int) int
- func (box *Inline) CalcHeight(contBlock Dimensions) (maxHeight, maxAsc, maxDesc int)
- func (box *Inline) CalcWidth(contBlock Dimensions) int
- func (i *Inline) IsEmpty() bool
- func (i *Inline) LayoutX(x int)
- func (i *Inline) Move(dx, dy int)
- func (box *Inline) MoveBaseline(dy int)
- func (i *Inline) Node() dom.Node
- func (b *Inline) Render(l *paint.List)
- func (box *Inline) Size() Dimensions
- func (box *Inline) Style() *style.Style
- func (box *Inline) SubtreeMinMax() (min int, max int)
- func (box *Inline) VerticalAlignNormalChildren(baseline int)
- type InlineBox
- type IntrinsicSizer
- type Line
- type LineBlock
- type Rect
- type Replaced
- func (r *Replaced) AlignBottom(y int)
- func (r *Replaced) AlignTop(y int) int
- func (r *Replaced) CalcHeight(contBlock Dimensions) (maxHeight, maxAsc, maxDesc int)
- func (r *Replaced) CalcWidth(contBlock Dimensions) int
- func (r *Replaced) LayoutX(x int)
- func (r *Replaced) Move(dx, dy int)
- func (r *Replaced) MoveBaseline(dy int)
- func (r *Replaced) Node() dom.Node
- func (r *Replaced) Render(l *paint.List)
- func (r *Replaced) Size() Dimensions
- func (r *Replaced) Style() *style.Style
- func (r *Replaced) SubtreeMinMax() (min int, max int)
- func (r *Replaced) VerticalAlignNormalChildren(baseline int)
- type Text
- func (_ *Text) AlignBottom(ybottom int)
- func (t *Text) AlignTop(y int) int
- func (t *Text) CalcHeight(_ Dimensions) (maxHeight, maxAsc, maxDesc int)
- func (t *Text) CalcWidth(_ Dimensions) int
- func (t *Text) LayoutX(x int)
- func (t *Text) Move(dx, dy int)
- func (t *Text) MoveBaseline(dy int)
- func (t *Text) Node() dom.Node
- func (t *Text) Render(l *paint.List)
- func (t *Text) Size() Dimensions
- func (t *Text) Style() *style.Style
- func (t *Text) SubtreeMinMax() (min int, max int)
- func (t *Text) VerticalAlignNormalChildren(baseline int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { Dimensions Children []BlockBox // contains filtered or unexported fields }
func (*Block) Layout ¶
func (b *Block) Layout(contBlock Dimensions)
func (*Block) Size ¶
func (b *Block) Size() Dimensions
type BlockBox ¶
type BlockBox interface { Box Layout(contBlock Dimensions) // contains filtered or unexported methods }
type Box ¶
func MakeInlines ¶
type Dimensions ¶
func (Dimensions) BorderRect ¶
func (d Dimensions) BorderRect() Rect
func (Dimensions) MarginRect ¶
func (d Dimensions) MarginRect() Rect
func (Dimensions) PaddingRect ¶
func (d Dimensions) PaddingRect() Rect
type Inline ¶
type Inline struct { Dimensions Children []InlineBox Font font.Font LeftOpen, RightOpen bool // contains filtered or unexported fields }
Inline is an inline box
func (*Inline) AlignBottom ¶
AlignBottom moves all bottom children down to the specified ybottom. AlignTop needs to be run before!
func (*Inline) AlignTop ¶
AlignTop aligns all children with vertical-layout set to top or bottom to the specified y position. bottom boxes will be moved down in a later step. it returns the height of the highest top/bottom subtree.
func (*Inline) CalcHeight ¶
func (box *Inline) CalcHeight(contBlock Dimensions) (maxHeight, maxAsc, maxDesc int)
func (*Inline) CalcWidth ¶
func (box *Inline) CalcWidth(contBlock Dimensions) int
func (*Inline) MoveBaseline ¶
func (*Inline) Size ¶
func (box *Inline) Size() Dimensions
func (*Inline) SubtreeMinMax ¶
func (*Inline) VerticalAlignNormalChildren ¶
type InlineBox ¶
type InlineBox interface { Box CalcWidth(contBlock Dimensions) int CalcHeight(contBlock Dimensions) (maxHeight, maxAsc, maxDesc int) // Testing! LayoutX(x int) Move(dx, dy int) VerticalAlignNormalChildren(baseline int) SubtreeMinMax() (min int, max int) AlignTop(y int) int AlignBottom(ybottom int) MoveBaseline(dy int) // contains filtered or unexported methods }
type IntrinsicSizer ¶
type Line ¶
type Line struct { Dimensions // rect+asc, rest should be 0 Inline *Inline HardBreak bool // contains filtered or unexported fields }
func (*Line) Layout ¶
func (l *Line) Layout(contBlock Dimensions)
func (*Line) Size ¶
func (l *Line) Size() Dimensions
type LineBlock ¶
type LineBlock struct {
Block
}
This will replace LineBlock when it's ready
func NewLineBlock ¶
NewLineBlock creates a LineBlock The argument is its parent's node (the block container)
func (*LineBlock) Layout ¶
func (b *LineBlock) Layout(contBlock Dimensions)
type Replaced ¶
type Replaced struct { Dimensions // contains filtered or unexported fields }
func (*Replaced) AlignBottom ¶
func (*Replaced) CalcHeight ¶
func (r *Replaced) CalcHeight(contBlock Dimensions) (maxHeight, maxAsc, maxDesc int)
TODO Padding? Border? Margin? see above ...
func (*Replaced) CalcWidth ¶
func (r *Replaced) CalcWidth(contBlock Dimensions) int
CalcWidth calculates the width of the replaced element. Uses the algorithm from http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#inline-replaced-width TODO Padding? Border? Margin? TODO deal with the undefined case TODO respect min-width and max-width The correct algorithm is in http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#min-max-widths It includes a complex table ...
func (*Replaced) MoveBaseline ¶
func (*Replaced) Size ¶
func (r *Replaced) Size() Dimensions
func (*Replaced) SubtreeMinMax ¶
func (*Replaced) VerticalAlignNormalChildren ¶
type Text ¶
type Text struct { Rect Text string Font font.Font LineHeight int Collapsible bool ForcesBreak bool AllowsBreak bool // contains filtered or unexported fields }
func (*Text) AlignBottom ¶
func (*Text) CalcHeight ¶
func (t *Text) CalcHeight(_ Dimensions) (maxHeight, maxAsc, maxDesc int)
func (*Text) CalcWidth ¶
func (t *Text) CalcWidth(_ Dimensions) int
func (*Text) MoveBaseline ¶
func (*Text) Size ¶
func (t *Text) Size() Dimensions