Context.strokeExtents
void strokeExtents(out double x1, out double y1, out double x2, out double y2)Computes a bounding box in user coordinates covering the area that would be affected, (the "inked" area), by a [cairo.context.Context.stroke] operation given the current path and stroke parameters. If the current path is empty, returns an empty rectangle ((0,0), (0,0)). Surface dimensions and clipping are not taken into account.
Note that if the line width is set to exactly zero, then [cairo.context.Context.strokeExtents] will return an empty rectangle. Contrast with [cairo.context.Context.pathExtents] which can be used to compute the non-empty bounds as the line width approaches zero.
Note that [cairo.context.Context.strokeExtents] must necessarily do more work to compute the precise inked areas in light of the stroke parameters, so [cairo.context.Context.pathExtents] may be more desirable for sake of performance if non-inked path extents are desired.
See [cairo.context.Context.stroke], [cairo.context.Context.setLineWidth], [cairo.context.Context.setLineJoin], [cairo.context.Context.setLineCap], [cairo.context.Context.setDash], and [cairo.context.Context.strokePreserve].
Parameters
x1 | left of the resulting extents |
y1 | top of the resulting extents |
x2 | right of the resulting extents |
y2 | bottom of the resulting extents |