[racket] Bounding Boxes

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Aug 5 12:37:33 EDT 2013

Hi All,

The dc-path% method get-bounding-box computes the bounding box not only for
the points on the path, but also for the control points defining the path.
This implies
that a bounding box can be much larger than the actual path.

Cairo supports computation of tighter bounding boxes. Some take the
pen in consideration and some do not:

    cairo-path-extents  cairo-stroke-extents  cairo-fill-extents

Am I so lucky that there already exists bindings to these?

/Jens Axel

Links to Cairo documentation:


http://www.cairographics.org/manual/cairo-Paths.html#cairo-path-extents
Computes a bounding box in user-space coordinates covering the points on
the current path. If the current path is empty, returns an empty rectangle
((0,0), (0,0)). Stroke parameters, fill rule, surface dimensions and
clipping are not taken into account.

http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-stroke-extents
Computes a bounding box in user coordinates covering the area that would be
affected, (the "inked" area), by a
cairo_stroke()<http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-stroke>
operation
given the current path and stroke parameters.

http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-fill-extents
Computes a bounding box in user coordinates covering the area that would be
affected, (the "inked" area), by a
cairo_fill()<http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-fill>
operation
given the current path and fill parameters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130805/06f3958b/attachment.html>

Posted on the users mailing list.