render/canvas.go

Functions

Functions

func NewCanvas

NewCanvas creates a [widget.Canvas] backed by the given [gg.Context].

 

The width and height specify the canvas dimensions in logical pixels.

The gg.Context should already be created with matching dimensions.

func NewCanvas(dc *gg.Context, width, height int) widget.Canvas {
	return render.NewCanvas(dc, width, height)
}