package panel import ( "git.wtrh.nl/patterns/gopatterns/pkg/dimensions" "git.wtrh.nl/patterns/gopatterns/pkg/path" "git.wtrh.nl/patterns/gopatterns/pkg/point" "git.wtrh.nl/patterns/gopatterns/pkg/util" "github.com/tdewolff/canvas" ) type Panel struct { Name string Lines map[util.ID]path.Path Points map[util.ID]point.Point Dimensions dimensions.Dimensions } func (p Panel) Draw(c *canvas.Canvas, face *canvas.FontFace, debug bool) error { for _, line := range p.Lines { err := line.Draw(c) if err != nil { return err } for _, throughPoint := range line.Through() { throughPoint.SetDraw() } } for _, drawPoints := range p.Points { point.Draw(c, drawPoints, face, debug) } return nil }