Package: cairo

Function cairo-stroke-extents

Lambda List

cairo-stroke-extents (cr)

Arguments

cr -- a cairo-t context

Return Value

x1 -- a double float with the left of the resulting extents
y1 -- a double float with the top of the resulting extents
x2 -- a double float with the right of the resulting extents
y2 -- a double float with the bottom of the resulting extents

Details

Computes a bounding box in user coordinates covering the area that would be affected, the "inked" area, by a cairo-stroke operation given the current path and stroke parameters. If the current path is empty, returns an empty rectangle. Surface dimensions and clipping are not taken into account.

Note that if the line width is set to exactly zero, then the cairo-stroke-extents function will return an empty rectangle. Contrast with the cairo-path-extents function which can be used to compute the non-empty bounds as the line width approaches zero.

Note that the cairo-stroke-extents function must necessarily do more work to compute the precise inked areas in light of the stroke parameters, so the cairo-path-extents function may be more desirable for sake of performance if non-inked path extents are desired.

See the cairo-stroke, cairo-set-line-width, cairo-set-line-join, cairo-set-line-cap, cairo-set-dash, and cairo-stroke-preserve functions.
 

See also

2021-12-12