From 3174484955c7c053eebba47c7562fcb4156c8c46 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 16 May 2015 13:19:33 +0200 Subject: Line method --- font.go | 3 +-- pic.go | 3 +-- robo.go | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/font.go b/font.go index 3774899..7b25e7f 100644 --- a/font.go +++ b/font.go @@ -39,8 +39,7 @@ func (f Font) Print(c *bufio.Writer, s string, off Point) Point { } off.Offset(c) for _, p := range gl.S { - p[0].Move(c) - p[1:].Draw(c) + p.Line(c) } off.Y += gl.W } diff --git a/pic.go b/pic.go index 07d960f..14cf701 100644 --- a/pic.go +++ b/pic.go @@ -39,7 +39,6 @@ func parsePage() (pa Page) { func DrawPic(c *bufio.Writer) { Landscape.Orientation(c) for _, p := range parsePage() { - p[0].Move(c) - p[1:].Draw(c) + p.Line(c) } } diff --git a/robo.go b/robo.go index 0e4e758..d2ca8a7 100644 --- a/robo.go +++ b/robo.go @@ -61,6 +61,11 @@ func (ph Path) Circle3P(c *bufio.Writer) { ph[0:3].send(c, "WP") } func (ph Path) CircleRelative(c *bufio.Writer) { ph[0:2].send(c, "]") } func (ph Path) Ellipse(c *bufio.Writer) { ph[0:4].send(c, ")") } +func (ph Path) Line(c *bufio.Writer) { + ph[0].Move(c) + ph[1:].Draw(c) +} + func (u Unit) send(c *bufio.Writer, a ...interface{}) { fmt.Fprint(c, a[0], u) for _, arg := range a[1:] { -- cgit v1.2.3