[cairo] how to interprete extents of rotated path

Behdad Esfahbod behdad at behdad.org
Mon May 26 14:55:06 PDT 2008


On Mon, 2008-05-26 at 22:07 +0200, Theo Veenker wrote:
> Hi,
> 
> I'm trying to get the bounding box of a path using cairo_stroke_extents().
> The returned numbers are OK when the path is not rotated, but when it is
> rotated the bounding box returned doesn't make sense to me.
> See http://www.let.uu.nl/~Theo.Veenker/personal/extents/ for my test
> program and two images.

Ugh.  Didn't know about this.

> What am I doing wrong here?

Nothing.  Wrong is the way we compute things internally.  It's the same
effect that I explained here, in another context:

  http://lists.cairographics.org/archives/cairo/2008-May/014152.html

Just last night I was thinking about writing a stroke/path extents
implementation that works on the double path directly, without any
tesselation.  That can easily fix this problem.


> Theo

-- 
behdad
http://behdad.org/

"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 mailing list