path2d

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package path2d provides retained canvas paths with an API mirroring the browser's Path2D object. Paths are recorded in WASM and materialized in JavaScript only when first drawn.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Path2D

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

func New

func New() (p *Path2D)

func (*Path2D) Arc

func (p *Path2D) Arc(x, y, radius, startAngle, endAngle float64, counterclockwise ...bool) (self *Path2D)

func (*Path2D) ArcTo

func (p *Path2D) ArcTo(x1, y1, x2, y2, radius float64) (self *Path2D)

func (*Path2D) BezierCurveTo

func (p *Path2D) BezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y float64) (self *Path2D)

func (*Path2D) ClosePath

func (p *Path2D) ClosePath() (self *Path2D)

func (*Path2D) CommandBytes

func (p *Path2D) CommandBytes() []byte

ID and CommandBytes are the internal bridge used by ctx2d. Applications normally only use the canvas-like path methods above.

func (*Path2D) Ellipse

func (p *Path2D) Ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle float64, counterclockwise ...bool) (self *Path2D)

func (*Path2D) Generate

func (p *Path2D) Generate(fn func(self *Path2D)) (self *Path2D)

func (*Path2D) ID

func (p *Path2D) ID() uint32

ID and CommandBytes are the internal bridge used by ctx2d. Applications normally only use the canvas-like path methods above.

func (*Path2D) LineTo

func (p *Path2D) LineTo(x, y float64) (self *Path2D)

func (*Path2D) MoveTo

func (p *Path2D) MoveTo(x, y float64) (self *Path2D)

func (*Path2D) QuadraticCurveTo

func (p *Path2D) QuadraticCurveTo(cpx, cpy, x, y float64) (self *Path2D)

func (*Path2D) Rect

func (p *Path2D) Rect(x, y, width, height float64) (self *Path2D)

func (*Path2D) RoundRect

func (p *Path2D) RoundRect(x, y, width, height, radius float64) (self *Path2D)

func (*Path2D) Version

func (p *Path2D) Version() int

Jump to

Keyboard shortcuts

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