Name
ccontext:PathExtents -- get path extents
Synopsis
x1, y1, x2, y2 = ccontext:PathExtents()
Function
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.

Contrast with ccontext:FillExtents() and ccontext:StrokeExtents() which return the extents of only the area that would be "inked" by the corresponding drawing operations.

The result of ccontext:PathExtents() is defined as equivalent to the limit of ccontext:StrokeExtents() with #CAIRO_LINE_CAP_ROUND as the line width approaches 0.0 (but never reaching the empty-rectangle returned by ccontext:StrokeExtents() for a line width of 0.0).

Specifically, this means that zero-area sub-paths such as ccontext:MoveTo();ccontext:LineTo() segments, (even degenerate cases where the coordinates to both calls are identical), will be considered as contributing to the extents. However, a lone ccontext:MoveTo() will not contribute to the results of ccontext:PathExtents().

Inputs
none

Results
x1
left of the resulting extents
y1
top of the resulting extents
x2
right of the resulting extents
y2
bottom of the resulting extents

Show TOC