border

package
v0.0.0-...-955f326 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2020 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Border

type Border interface {
	// Insets returns the insets describing the space the border occupies on
	// each side.
	Insets() geom.Insets
	// Draw the border into rect.
	Draw(gc draw.Context, rect geom.Rect, inLiveResize bool)
}

Border defines methods required of all border providers.

type Compound

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

Compound provides stacking of borders together.

func NewCompound

func NewCompound(borders ...Border) *Compound

NewCompound creates a border that contains other borders. The first one will be drawn in the outermost position, with each successive one moving further into the interior.

func (*Compound) Draw

func (b *Compound) Draw(gc draw.Context, rect geom.Rect, inLiveResize bool)

Draw the border into rect.

func (*Compound) Insets

func (b *Compound) Insets() geom.Insets

Insets returns the insets describing the space the border occupies on each side.

type Empty

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

Empty provides and empty border with the specified insets.

func NewEmpty

func NewEmpty(insets geom.Insets) *Empty

NewEmpty creates a new empty border with the specified insets.

func (*Empty) Draw

func (b *Empty) Draw(gc draw.Context, rect geom.Rect, inLiveResize bool)

Draw the border into rect.

func (*Empty) Insets

func (b *Empty) Insets() geom.Insets

Insets returns the insets describing the space the border occupies on each side.

type Line

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

Line private a lined border.

func NewLine

func NewLine(ink draw.Ink, cornerRadius float64, insets geom.Insets, noInset bool) *Line

NewLine creates a new line border. The cornerRadius specifies the amount of rounding to use on the corners. The insets represent how thick the border will be drawn on that edge. If noInset is true, the Insets() method will return zeroes.

func (*Line) Draw

func (b *Line) Draw(gc draw.Context, rect geom.Rect, inLiveResize bool)

Draw the border into rect.

func (*Line) Insets

func (b *Line) Insets() geom.Insets

Insets returns the insets describing the space the border occupies on each side.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL