Пример #1
0
func canvasContext(c jquery.JQuery) (x *canvas.Context) {
	x = canvas.GetContext(c)

	h := float64(c.Width())
	w := float64(c.Height())

	x.PixelsPerPoint = screenPixelsPerPoint
	x.PointsPerPixel = 1 / screenPixelsPerPoint
	x.Size = r2.XY(h*x.PointsPerPixel, w*x.PointsPerPixel)

	// Always work in points not pixels.
	x.Scale(r2.XY1(screenPixelsPerPoint))

	return
}