aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go2
-rw-r--r--pic.go9
2 files changed, 6 insertions, 5 deletions
diff --git a/main.go b/main.go
index 307e0c2..71fe893 100644
--- a/main.go
+++ b/main.go
@@ -41,6 +41,6 @@ func main() {
//fmt.Println("Call Gin", c.CallGin())
//c.MustMarks(Point{19 * CM, 18 * CM})
- c.DrawPic(Point{11 * IN, 0})
+ c.DrawPic()
}
diff --git a/pic.go b/pic.go
index da8129d..ff4e5f3 100644
--- a/pic.go
+++ b/pic.go
@@ -14,7 +14,7 @@ func parseLine(s string) (pa Path) {
if strings.HasPrefix(s, "line from ") {
for _, p := range strings.Split(s[10:], " to ") {
var po Point
- fmt.Sscanf(p, "%v,%v", &po.Y, &po.X)
+ fmt.Sscanf(p, "%v,%v", &po.X, &po.Y)
po.X = po.X * IN
po.Y = po.Y * IN
pa = append(pa, po)
@@ -36,11 +36,12 @@ func parsePage() (pa Page) {
return pa
}
-func (c Cutter) DrawPic(cor Point) {
+func (c Cutter) DrawPic() {
+ c.Orientation(Landscape)
for _, path := range parsePage() {
- c.Move(cor.Sub(path[0]))
+ c.Move(path[0])
for _, p := range path[1:] {
- c.Draw(cor.Sub(p))
+ c.Draw(p)
}
}
}