|
From: Pete B. <pet...@ge...> - 2010-06-04 14:24:52
|
Maybe a bad suggestion (in DRY terms), but you make a custom stroker by cloning the conv_stroke and vcgen_stroke code, then in vcgen_stroke, change the path command returned in vertex(...) to path_cmd_move_to for the line caps? Phil Endecott wrote: > Dear Experts, > > I am attempting to draw a simple dashed double line, i.e. something like > > - - - - - - - - - - - - - > - - - - - - - - - - - - - > > My first attempt used stroke -> dash -> stroke. This has two problems: > the lines wrap around the ends, and the dashes on the sides are not > aligned especially if the line is not straight: > > - - - - - - - - - - - - - - - - -| > | - - - - - - - - - - - - - - - - - > > Then I tried dash -> stroke -> stroke. This makes the two sides > aligned, but of course it adds ends to each segment: > > +--+ +--+ +--+ +--+ +--+ > | | | | | | | | | | > +--+ +--+ +--+ +--+ +--+ > > My final attempt was using contour to make a "left path" and a "right > path", and to dash and stroke them separately: > > contour(width=+n) -> dash -> stroke > contour(width=-n) -> dash -> stroke > > This doesn't work either, and I think I am probably misunderstanding > what contour should do to a non-closed path. > > Alignment of the dashes on each side would be good but is not > essential. What is essential is not having stuff that wraps around the ends. > > I think the easiest way to make this work would be if stroke had a way > to specify "none" as the cap style. Then I could do dash -> > stroke(cap=none) -> stroke. Is there some way to achieve that? Or can > someone suggest another way to do this? > > > Thanks, Phil. > > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Vector-agg-general mailing list > Vec...@li... > https://lists.sourceforge.net/lists/listinfo/vector-agg-general > > |