[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
behdad at behdad.org
Mon Jan 21 22:04:00 PST 2008
On Mon, 2008-01-21 at 21:40 -0800, Carl Worth wrote:
> 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.
> PS. If you want to fix another one of the victims of my failing
> spacebar above, please feel free.
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
More information about the cairo