Date: | 2010-12-15 16:26:44 (13 years 3 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 99592248d9a286c50adc76bcb49347b51ba0785c |
Message: | cameo/gerber.c (gerber_read): store coordinates as floats after
conversion They all were truncated. |
Files: |
cameo/gerber.c (2 diffs) |
Change Details
cameo/gerber.c | ||
---|---|---|
37 | 37 | int lineno = 0; |
38 | 38 | char buf[1024]; |
39 | 39 | struct path *paths = NULL, **anchor = &paths, *path = NULL; |
40 | int start_x = 0, start_y = 0; | |
41 | int x, y, d; | |
40 | double start_x = 0, start_y = 0; | |
41 | int xi, yi, d; | |
42 | double x, y; | |
42 | 43 | |
43 | 44 | file = name ? fopen(name, "r") : stdin; |
44 | 45 | if (!file) { |
... | ... | |
64 | 65 | } |
65 | 66 | continue; |
66 | 67 | } |
67 | if (sscanf(buf, "X%dY%dD%d*\n", &x, &y, &d) != 3) | |
68 | if (sscanf(buf, "X%dY%dD%d*\n", &xi, &yi, &d) != 3) | |
68 | 69 | continue; |
69 | x = KU2MM(x); | |
70 | y = KU2MM(y); | |
70 | x = KU2MM(xi); | |
71 | y = KU2MM(yi); | |
71 | 72 | switch (d) { |
72 | 73 | case 1: |
73 | 74 | if (!path) { |
Branches:
master