Ticket #68: ticket68.patch
File ticket68.patch, 2.8 KB (added by , 8 years ago) |
---|
-
src/extend.c
diff --git a/src/extend.c b/src/extend.c index 40a68678..4e0c00e8 100644
a b static img *pimg_out; 83 83 84 84 static int show_breaks = 0; 85 85 86 static void do_stn(point *, double, const char *, int, int);86 static void do_stn(point *, point *, double, const char *, int, int); 87 87 88 88 typedef struct pfx { 89 89 const char *label; … … main(int argc, char **argv) 636 636 } 637 637 } 638 638 } 639 fprintf(stderr, "*start %s\n", start->stns->label); 639 640 640 641 /* TRANSLATORS: for extend: 641 642 * Used to tell the user that a file is being written - %s is the filename … … main(int argc, char **argv) 645 646 pimg_out = img_open_write(fnm_out, desc, img_FFLAG_EXTENDED); 646 647 647 648 /* Only does single connected component currently. */ 648 do_stn( start, 0.0, NULL, ERIGHT, 0);649 do_stn(NULL, start, 0.0, NULL, ERIGHT, 0); 649 650 650 651 if (have_xsect) { 651 652 img_rewind(pimg); … … static int adjust_direction(int dir, int by) { 694 695 } 695 696 696 697 static void 697 do_stn(point * p, double X, const char *prefix, int dir, int labOnly)698 do_stn(point * prev, point *p, double X, const char *prefix, int dir, int labOnly) 698 699 { 699 700 leg *l, *lp; 700 701 double dX; … … do_stn(point *p, double X, const char *prefix, int dir, int labOnly) 704 705 for (s = p->stns; s; s = s->next) { 705 706 img_write_item(pimg_out, img_LABEL, s->flags, s->label, X, 0, p->p.z); 706 707 } 707 if (show_breaks && p->X != HUGE_VAL && p->X != X) { 708 /* Draw "surface" leg between broken stations. */ 709 img_write_item(pimg_out, img_MOVE, 0, NULL, p->X, 0, p->p.z); 710 img_write_item(pimg_out, img_LINE, img_FLAG_SURFACE, NULL, X, 0, p->p.z); 708 if (p->X != HUGE_VAL && p->X != X) { 709 fprintf(stderr, "*break %s %s\n", p->stns->label, prev->stns->label); 710 if (show_breaks) { 711 /* Draw "surface" leg between broken stations. */ 712 img_write_item(pimg_out, img_MOVE, 0, NULL, p->X, 0, p->p.z); 713 img_write_item(pimg_out, img_LINE, img_FLAG_SURFACE, NULL, X, 0, p->p.z); 714 } 711 715 } 712 716 p->X = X; 713 717 if (labOnly || p->fBroken) { … … do_stn(point *p, double X, const char *prefix, int dir, int labOnly) 743 747 img_write_item(pimg_out, img_LINE, l->flags, l->prefix, 744 748 X, 0, l->to->p.z); 745 749 l->fDone = 1; 746 do_stn( l->fr, X + dX, l->prefix, dir, (l->broken & BREAK_FR));750 do_stn(p, l->fr, X + dX, l->prefix, dir, (l->broken & BREAK_FR)); 747 751 l = lp; 748 752 } else if (l->fr == p) { 749 753 if (l->broken & BREAK_FR) continue; … … do_stn(point *p, double X, const char *prefix, int dir, int labOnly) 758 762 img_write_item(pimg_out, img_LINE, l->flags, l->prefix, 759 763 X + dX, 0, l->to->p.z); 760 764 l->fDone = 1; 761 do_stn( l->to, X + dX, l->prefix, dir, (l->broken & BREAK_TO));765 do_stn(p, l->to, X + dX, l->prefix, dir, (l->broken & BREAK_TO)); 762 766 l = lp; 763 767 } 764 768 }