[cairo] [cairo-commit] 3 commits - src/cairo.c src/cairo-path-stroke.c test/get-path-extents.c test/.gitignore test/Makefile.am test/rectilinear-miter-limit.c test/rectilinear-miter-limit-ref.png

Carl Worth cworth at cworth.org
Mon Jan 21 21:40:48 PST 2008


On Mon, 21 Jan 2008 20:37:06 -0500, Behdad Esfahbod wrote:
> On Mon, 2008-01-21 at 19:47 -0500, Carl Worth wrote:
> > +     * can't usethis optimization. Remember, the ratio is
> > +     * 1/sin(ɸ/2). So the cutoff is 1/sin(π/4.0) or ⎷2 or
...
>   - Change the check to:
> 
>     if (stroke_style->miter_limit < M_SQRT2)
>        return CAIRO_INT_STATUS_UNSUPPORTED;
> 
> This way if the user sets miter limit exactly to M_SQRT2, we're on the
> safe side.

Good catch. When I first wrote the code I was still thinking of the
constant in terms of 1/sin(M_PI_4), so I didn't see any good way to
get that "exact" trig value at compile time.

But using M_SQRT2 is definitely a good idea.

> I can push.

Please do.

-Carl

PS. If you want to fix another one of the victims of my failing
spacebar above, please feel free.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080121/8906a5a6/attachment.pgp 


More information about the cairo mailing list