From 69668aa61de642ea275e6e2ace85f7b921480603 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 6 May 2015 23:35:58 +0200 Subject: Separate Units --- pic.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'pic.go') diff --git a/pic.go b/pic.go index 5a80605..da8129d 100644 --- a/pic.go +++ b/pic.go @@ -10,17 +10,13 @@ import ( type Page []Path -func truncate(f float64) float64 { - return float64(int(f*100)) / 100 -} - 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) - po.X = truncate(po.X * IN) - po.Y = truncate(po.Y * IN) + po.X = po.X * IN + po.Y = po.Y * IN pa = append(pa, po) } } -- cgit v1.2.3