[cairo] Solving the self-intersecting stroke

Behdad Esfahbod behdad at behdad.org
Mon Oct 6 08:41:00 PDT 2008


Chris Wilson wrote:
> Behdad, lets get twin.c into the test suite, it exercises more of the
> Bentley-Ottmann tessellator than all of the other tests!

The waterfall is a bit too large fr the test suite.  Feel free to add a
test just showing the more interesting letters ('a', 'g', 'y', 'w', ...) at
various sizes.  Also note that I'm going to change the weight of the stroke.
In all, better wait until the hinting stuff is implemented before adding it to
the test suite.  Working on it.

Cheers,

behdad


> As the keen observer will see, along with some refinement I also
> introduced a very nasty bug that was causing trapezoids to be lost.
> 
> Carl could you please review the attached patch for correctness. I
> believe I've found an issue with _cairo_bo_sweep_line_compare_edges() in
> the manner in which it compares the current points along the two edges.
> AIUI,
>   if (ax.rem < bx.rem)
>      return 1;
> is a buggy construct as the remainder is a fraction of its divider, so
> the correct test would look like:
>   if (ax.rem/ady < bx.rem/bdy)
>     return 1;
> modulo performing the integer arithmetic correctly.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo



More information about the cairo mailing list