aboutsummaryrefslogtreecommitdiff
path: root/pic.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-06 21:24:58 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-06 21:24:58 +0200
commitb028c5749cf400417109539faac07f8ad9236f3d (patch)
tree3d3a269145c9fc948d3d9c66b7f0ab1903531e02 /pic.go
parent54b04cef8c790eb544d46305b0837a6e61fa88af (diff)
Move correction out of PicParse
Diffstat (limited to 'pic.go')
-rw-r--r--pic.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pic.go b/pic.go
index d16e6e1..bee5745 100644
--- a/pic.go
+++ b/pic.go
@@ -19,7 +19,7 @@ func parseLine(s string) (pa Path) {
for _, p := range strings.Split(s[10:], " to ") {
var po Point
fmt.Sscanf(p, "%v,%v", &po.Y, &po.X)
- po.X = truncate(11*IN - po.X*IN)
+ po.X = truncate(po.X * IN)
po.Y = truncate(po.Y * IN)
pa = append(pa, po)
}
@@ -40,11 +40,11 @@ func parsePage() (pa Page) {
return pa
}
-func (c Cutter) DrawPic() {
+func (c Cutter) DrawPic(cor Point) {
for _, path := range parsePage() {
- c.Move(path[0])
+ c.Move(path[0].Add(cor))
for _, p := range path[1:] {
- c.Draw(p)
+ c.Draw(p.Add(cor))
}
}
}