[cairo] Solving the self-intersecting stroke

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 1 15:48:46 PDT 2008


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

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.
-- 
Chris Wilson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006--tessellator-Compare-fractional-remainders-wrt-to-t.patch
Type: text/x-patch
Size: 0 bytes
Desc: 
Url : http://lists.cairographics.org/archives/cairo/attachments/20081001/7f515ed1/attachment.bin 


More information about the cairo mailing list