#include "defs.h" /* * Make a sequence of adjoining segments from an arbitrary point. * * h = item header * k = 'a' or 'e' or 'z' * a finds a segment close to the cursor * z allows non-manhatten lines * */ path(h,k,s) DL h; CHAR k; { DL1 p1, q1; REG DL p; REG INT zmode; chkhd(h, "wBL"); must(cursor(p1)); if(k == 'a' && !findseg(h,p1)) error("cannot find segment"); h->flag |= DIRTY; zmode = (k == 'z'); p = newdlw(AFTER, h, 'e', START|END, p1, s); wchar(p, '+'); while(cursor(q1)==SP) { if(xysame(p, q1)==0){ p->flag &= ~END; style(-1, 0, s & 7); mode(GRAPH); wvec(p); if (zmode == 0){ if(abs(p->x - q1->x) > abs(p->y - q1->y)) q1->y = p->y; else q1->x = p->x; } p = newdlw(AFTER, p, 'e', END, q1, s); wvec(p); } } }