示例#1
0
文件: ui.go 项目: juanfgs/checkers
// draw the piece on the canvas
func (self *MainWindow) DrawSelector(cr *cairo.Context, x, y float64) {

	cr.SetSourceRGBA(0.2, 0.8, 0.2, 0.8)
	cr.SetLineWidth(5)
	cr.Rectangle(x*self.tileWidth, y*self.tileHeight, self.tileWidth, self.tileHeight)
	cr.Stroke()

}
示例#2
0
文件: line.go 项目: axel-freesp/sge
func DrawAccLine(gc *cairo.Context, x1, y1 float64, p2 image.Point) {
	gc.MoveTo(x1, y1)
	gc.LineTo(float64(p2.X), float64(p2.Y))
	gc.Stroke()
}
示例#3
0
文件: line.go 项目: axel-freesp/sge
func DrawLine(gc *cairo.Context, p1, p2 image.Point) {
	gc.MoveTo(float64(p1.X), float64(p1.Y))
	gc.LineTo(float64(p2.X), float64(p2.Y))
	gc.Stroke()
}