[cairo] Obtaining bounding box of a path

David Reveman c99drn at cs.umu.se
Tue Jun 1 15:27:08 PDT 2004


On Tue, 2004-06-01 at 17:46 -0400, Tim Rowley wrote:
> A bit of functionality I'd like to see added to cairo is the
> ability to obtain the bounding box of a path.  This would be
> useful in implementing the object bounding coordinate units of
> svg (currently hardwired in libxsvg).
> 
> Didn't see this mentioned in the cairo todo list, so thought I
> might bring it up here.

It's already in there.

from cairo.h:

/* Rectangular extents */
void
cairo_stroke_extents (cairo_t *cr,
            double *x1, double *y1,
            double *x2, double *y2);

void
cairo_fill_extents (cairo_t *cr,
          double *x1, double *y1,
          double *x2, double *y2);


Getting object bounding coordinate units working with libsvg-cairo would
be great, a lot of svgs are using those, especially for gradients.
Another thing that's supported by cairo but not yet added to
libsvg-cairo is gradient matrix support.
 
-David





More information about the cairo mailing list