From f07b0c28f6c4c49b742b1dfb315f7fc755edb223 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 2 May 2015 23:57:37 +0200 Subject: Add ellipse --- cutter.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'cutter.go') diff --git a/cutter.go b/cutter.go index 2e087a4..d02e3f0 100644 --- a/cutter.go +++ b/cutter.go @@ -92,9 +92,13 @@ const ( ESC = 0x1b ) -func (c Cutter) Send(a ...interface{}) { +func (c Cutter) Add(a ...interface{}) { fmt.Fprint(c, a...) c.WriteByte(ETX) +} + +func (c Cutter) Send(a ...interface{}) { + c.Add(a...) c.Flush() } @@ -367,3 +371,17 @@ func (c Cutter) Circle(p Point, start, end Polar) { start.R, ",", end.R, ",", start.Theta, ",", end.Theta) } + +// Not supported? +func (c Cutter) Curve(a int, ph Path) { + c.Add("Y", a) + for _, p := range ph { + c.Add(",", p) + } + c.Flush() +} + +func (c Cutter) Ellipse(a int, p Point, start, end Polar, theta int) { + c.Send(")", a, ",", p, ",", start.R, ",", end.R, ",", + start.Theta, ",", end.Theta, ",", theta) +} -- cgit v1.2.3