// 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() }
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() }
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() }