类型 Row

API 文档由 Go 源码生成,内容为英文。

type Row struct {
	// contains filtered or unexported fields
}

Row lays out slots left to right with a fixed gap. It is a value type: slot bookkeeping stays on the stack and layout allocates nothing.

构造函数

BeginRow#

func BeginRow(bounds Rect, gap float32) Row

BeginRow starts a horizontal stack inside bounds.

方法

Even#

func (r *Row) Even(n int) []Rect

Even returns n equal-width slots (divided over the remaining width, gaps between them) in one call.

Next#

func (r *Row) Next(width float32) Rect

Next returns the next slot with the requested width. Slots are full height.

NextFlex#

func (r *Row) NextFlex() Rect

NextFlex returns one slot filling all remaining width.

Remaining#

func (r Row) Remaining() float32

Remaining reports the unclaimed width, ignoring a trailing gap.