drawutil

package
v2.0.0-...-7f6935a Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Intersect

func Intersect(r, s image.Rectangle) image.Rectangle

Differs from image.Rectangle.Intersect in that it return {r.Min,r.Min} on empty.

func RectInset

func RectInset(r image.Rectangle, xn, yn int) image.Rectangle

Differs from image.Rectangle.Inset in that it accepts x and y args.

Types

type Drawer

type Drawer interface {
	Reader() iorw.ReaderAt
	SetReader(iorw.ReaderAt)
	ContentChanged()

	FontFace() *fontutil.FontFace
	SetFontFace(*fontutil.FontFace)
	LineHeight() int
	SetFg(color.Color)

	Bounds() image.Rectangle
	SetBounds(image.Rectangle)

	// rune offset  (set text view position; save/restore view in session file)
	RuneOffset() int
	SetRuneOffset(int)

	LocalPointOf(index int) image.Point
	LocalIndexOf(image.Point) int

	Measure() image.Point
	Draw(img draw.Image)

	// specialized: covers editor row button margin
	FirstLineOffsetX() int
	SetFirstLineOffsetX(x int)

	// cursor
	SetCursorOffset(int)

	// scrollable utils
	ScrollOffset() image.Point
	SetScrollOffset(image.Point)
	ScrollSize() image.Point
	ScrollViewSize() image.Point
	ScrollPageSizeY(up bool) int
	ScrollWheelSizeY(up bool) int

	// visibility utils
	RangeVisible(offset, n int) bool
	RangeVisibleOffset(offset, n int) int
}

type SyntaxHighlightComment

type SyntaxHighlightComment struct {
	S, E   string // {start,end} sequence
	IsLine bool   // single line comment (end argument is ignored)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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