Index: read.c =================================================================== --- read.c (revision 21658) +++ read.c (revision 21659) @@ -1017,6 +1017,21 @@ return 0; } +static void eagle_read_poly_corner(read_state_t *st, trnode_t *n, pcb_poly_t *poly, const char *xname, const char *yname, eagle_loc_t loc) +{ + pcb_coord_t x, y; + x = eagle_get_attrc(st, n, xname, 0); + y = eagle_get_attrc(st, n, yname, 0); + pcb_poly_point_new(poly, x, y); + switch (loc) { + case IN_SUBC: + break; + case ON_BOARD: + size_bump(st, x, y); + break; + } +} + static int eagle_read_poly(read_state_t *st, trnode_t *subtree, void *obj, int type) { eagle_loc_t loc = type; @@ -1048,27 +1063,8 @@ } TODO("TODO can remove the following if dealt with in post processor for binary tree") } else if (STRCMP(NODENAME(n), "wire") == 0) { /* binary format vertices it seems */ - pcb_coord_t x, y; - x = eagle_get_attrc(st, n, "linetype_0_x1", 0); - y = eagle_get_attrc(st, n, "linetype_0_y1", 0); - pcb_poly_point_new(poly, x, y); - switch (loc) { - case IN_SUBC: - break; - case ON_BOARD: - size_bump(st, x, y); - break; - } - x = eagle_get_attrc(st, n, "linetype_0_x2", 0); - y = eagle_get_attrc(st, n, "linetype_0_y2", 0); - pcb_poly_point_new(poly, x, y); - switch (loc) { - case IN_SUBC: - break; - case ON_BOARD: - size_bump(st, x, y); - break; - } + eagle_read_poly_corner(st, n, poly, "linetype_0_x1", "linetype_0_y1", loc); + eagle_read_poly_corner(st, n, poly, "linetype_0_x2", "linetype_0_y2", loc); } }