Ejemplo n.º 1
0
func rect(x, y, w, h C.double) cairo.Rectangle {
	return cairo.RectWH(float64(x), float64(y), float64(w), float64(h))
}
Ejemplo n.º 2
0
						LineTo(rbsyr).
						CurveTo(rb, rb, rbsxr).
						LineTo(lbaxr).
						CurveTo(lb, lb, ltayr)
				}
			}

			c.ClosePath()
			c.SetSourceColor(cairo.Color{.5, .5, 1})
			c.FillPreserve()
			c.SetSourceColor(cairo.AlphaColor{R: .5, A: .5})
			c.SetLineWidth(10)
			c.Stroke()
		}

		curveRect(c, cairo.RectWH(25.6, 25.6, 204.8, 204.8), 102.4)
		return nil
	}},
	{"curve-to", func(c *cairo.Context) error {
		ps := pt(25.6, 128)
		p1 := pt(102.4, 230.4)
		p2 := pt(153.6, 25.6)
		p3 := pt(230.4, 128)

		c.
			MoveTo(ps).
			CurveTo(p1, p2, p3).
			SetLineWidth(10).
			Stroke()

		c.