Documentation

Index

Constants

View Source
const FitContent = 1e6

Variables

View Source
var (
	LeftRoundBraket  = &Label{Text: "(", MaxWidth: FitContent}
	RightRoundBraket = &Label{Text: ")", MaxWidth: FitContent}

	LeftSquareBraket  = &Label{Text: "[", MaxWidth: FitContent}
	RightSquareBraket = &Label{Text: "]", MaxWidth: FitContent}

	LeftCurlyBraket  = &Label{Text: "{", MaxWidth: FitContent}
	RightCurlyBraket = &Label{Text: "}", MaxWidth: FitContent}
)
View Source
var (
	PlusSymbol       = &Label{Text: "+", MaxWidth: FitContent}
	MinusSymbol      = &Label{Text: "-", MaxWidth: FitContent}
	MultiplySymbol   = &Label{Text: "*", MaxWidth: FitContent}
	FactorSymbol     = &Label{Text: "!", MaxWidth: FitContent}
	InterpunctSymbol = &Label{Text: "·", MaxWidth: FitContent}
	ModuloSymbol     = &Label{Text: "%", MaxWidth: FitContent}

	SqrtSymbol = &Label{Text: "√", MaxWidth: FitContent}
)

Functions

This section is empty.

Types

type Fraction

type Fraction struct {
	Numerator, Denominator Shape
}

func (*Fraction) Dimensions

func (f *Fraction) Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions

func (*Fraction) Layout

func (f *Fraction) Layout(gtx *layout.Context, s style.Style)

type Group

type Group struct {
	Parts                  []Shape
	Subscript, SuperScript *Shape
}

func (*Group) Dimensions

func (g *Group) Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions

func (*Group) Layout

func (g *Group) Layout(gtx *layout.Context, s style.Style)

type Label

type Label struct {
	Text string
	// Alignment specify the text alignment.
	Alignment text.Alignment
	// MaxWith limits the with of a label, FitContent to limits the width to fit the content.
	MaxWidth int
	// MaxLines limits the number of lines. Zero means no limit.
	MaxLines int
}

Label is a widget for laying out and drawing text.

func (*Label) Dimensions

func (l *Label) Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions

func (Label) Layout

func (l Label) Layout(gtx *layout.Context, s style.Style)

type LineIterator

type LineIterator struct {
	Lines     []text.Line
	Clip      image.Rectangle
	Alignment text.Alignment
	Width     int
	Offset    image.Point
	// contains filtered or unexported fields
}

func (*LineIterator) Next

func (l *LineIterator) Next() (text.String, f32.Point, bool)

type Operator

type Operator struct {
	Symbol, Left, Right Shape
}

func (*Operator) Dimensions

func (o *Operator) Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions

func (*Operator) Layout

func (o *Operator) Layout(gtx *layout.Context, s style.Style)

type Shape

type Shape interface {
	Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions
	Layout(gtx *layout.Context, s style.Style)
}

func Factor

func Factor(left, right Shape) Shape

func Minus

func Minus(left, right Shape) Shape

func Modulo

func Modulo(left, right Shape) Shape

func Multiply

func Multiply(left, right Shape) Shape

func Plus

func Plus(left, right Shape) Shape

func Power

func Power(base, exponent Shape) Shape

func Sqrt

func Sqrt(body Shape) Shape

type Word

type Word struct {
	Content                Shape
	Subscript, Superscript Shape
}

func (*Word) Dimensions

func (w *Word) Dimensions(gtx *layout.Context, s style.Style) layout.Dimensions

func (*Word) Layout

func (w *Word) Layout(gtx *layout.Context, s style.Style)