diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-05-06 21:24:58 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-05-06 21:24:58 +0200 |
commit | b028c5749cf400417109539faac07f8ad9236f3d (patch) | |
tree | 3d3a269145c9fc948d3d9c66b7f0ab1903531e02 /pic.go | |
parent | 54b04cef8c790eb544d46305b0837a6e61fa88af (diff) |
Move correction out of PicParse
Diffstat (limited to 'pic.go')
-rw-r--r-- | pic.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)) } } } |