border

package
v0.0.0-...-af996ba Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 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 'bounds'.
	Draw(gc *draw.Graphics, bounds geom.Rect)
}

The Border interface should be implemented by objects that provide a border around an area.

type Compound

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

Compound is a border that contains other borders.

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 (c *Compound) Draw(gc *draw.Graphics, bounds geom.Rect)

Draw implements the Border interface.

func (*Compound) Insets

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

Insets implements the Border interface.

type Empty

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

Empty is a border that contains empty space, effectively providing an empty margin.

func NewEmpty

func NewEmpty(insets geom.Insets) *Empty

NewEmpty creates a new empty border with the specified insets.

func (*Empty) Draw

func (e *Empty) Draw(gc *draw.Graphics, bounds geom.Rect)

Draw implements the Border interface.

func (*Empty) Insets

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

Insets implements the Border interface.

type Line

type Line struct {

	// NoInset will cause the Insets() method to return zeroes if true.
	NoInset bool
	// contains filtered or unexported fields
}

Line is a border that draws a line along some or all of its sides.

func NewLine

func NewLine(color color.Color, insets geom.Insets) *Line

NewLine creates a new line border. The insets represent how thick the border will be drawn on that edge.

func (*Line) Draw

func (line *Line) Draw(gc *draw.Graphics, bounds geom.Rect)

Draw implements the Border interface.

func (*Line) Insets

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

Insets implements the Border interface.

Jump to

Keyboard shortcuts

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