Re: [LIBART] Working on new canvas item...



"James K. Wiggs" wrote:

>     Ahh, excellent.  My impression from the documentation and the
> source code I studied was that the vector paths had to be "closed"
> in the sense that you can't "lift the pen" once you start drawing.
> But it *is* possible to mix MOVETOs and LINETOs.  OK, made these
> changes *and* put the art_vpath_perturb() call back in.  I still
> get a few of these:
> 
> x_order_2: colinear!
> 
>    But only about 10 of them for ~430 pricebars.  I suspect that
> I'm getting them on pricebars where the open/close tics are at
> the same value.  And also, there are no *visible* plotting
> artifacts like "blocks" or tics that extend halfway across the
> graph.

Thanks, Lauris, for providing such useful help!

Here's a suggestion that may reduce the colinear warnings. Lauris
suggests:

> MOVETO_OPEN (opening tic) LINETO (bar)
> MOVETO_OPEN (bottom of bar) LINETO (top of bar)
> MOVETO_OPEN (bar) LINETO (closing tic)
> ART_END

I'd suggest checking to see if opening and closing tics are equal to the
top or bottom of the bar, and keeping the pen down in those cases.

It's a little more code (it looks like you have to check all four cases
of opening or closing tics matching top or bottom), but you should run
quite a bit more stably.

Hope this helps,

Raph

-- 
Raph Levien <raph artofcode com>  |  artofcode LLC  |  www.artofcode.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]