Package: cairo

Function cairo:path-extents

Lambda List

cairo:path-extents (cr)

Arguments

cr -- a cairo:context-t instance

Return Value

x1 -- a number for the left of the resulting extents
y1 -- a number for the top of the resulting extents
x2 -- a number for the right of the resulting extents
y2 -- a number for the bottom of the resulting extents

Details

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. Stroke parameters, fill rule, surface dimensions and clipping are not taken into account.

Contrast with the cairo:fill-extents and cairo:stroke-extents functions which return the extents of only the area that would be "inked" by the corresponding drawing operations.

The result of the cairo:path-extents function is defined as equivalent to the limit of the cairo:stroke-extents function with the :round value as the line width approaches 0.0, but never reaching the empty-rectangle returned by the cairo:stroke-extents function for a line width of 0.0.

Specifically, this means that zero-area sub-paths such as cairo:move-to, cairo:line-to segments, even degenerate cases where the coordinates to both calls are identical, will be considered as contributing to the extents. However, a lone cairo:move-to will not contribute to the results of the cairo:path-extents function.

Notes

The numbers returned are double floats.
 

See also

2025-1-14