package module
Version: v0.0.0-...-1165ff2 Latest Latest

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 11 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Canvas

type Canvas struct {
	Shaper text.Shaper
	// contains filtered or unexported fields

Canvas describes the top-level ptx drawing context.

func New

func New(shaper text.Shaper, size f32.Point) *Canvas

New creates a new SVG canvas.

func (*Canvas) Add

func (c *Canvas) Add(gtx layout.Context)

Layout renders plot to gtx.

func (*Canvas) Bounds

func (ptx *Canvas) Bounds() plot.Rect

Bounds returns the bounds in the global size.

func (*Canvas) Clip

func (ptx *Canvas) Clip(r plot.Rect) plot.Canvas

Clip clips to rect.

func (*Canvas) Context

func (ptx *Canvas) Context(r plot.Rect) plot.Canvas

context creates a subcontext bounded to r.

func (*Canvas) Layer

func (ptx *Canvas) Layer(index int) plot.Canvas

Layer returns an layer above or below current state.

func (*Canvas) Poly

func (ptx *Canvas) Poly(points []plot.Point, style *plot.Style)

Poly draws a polygon.

func (*Canvas) Rect

func (ptx *Canvas) Rect(r plot.Rect, style *plot.Style)

Rect draws a rectangle.

func (*Canvas) Size

func (ptx *Canvas) Size() plot.Point

Size returns the size of the context.

func (*Canvas) Text

func (ptx *Canvas) Text(text string, at plot.Point, style *plot.Style)

Text draws text.

Source Files


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to