Name
ccontext:StrokeExtents -- get stroke extents
Synopsis
x1, y1, x2, y2 = ccontext:StrokeExtents()
Function
Computes a bounding box in user coordinates covering the area that would be affected, the "inked" area, by a ccontext: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 ccontext:StrokeExtents() will return an empty rectangle. Contrast with ccontext:PathExtents() which can be used to compute the non-empty bounds as the line width approaches zero.

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

See ccontext:Stroke(), ccontext:SetLineWidth(), ccontext:SetLineJoin(), ccontext:SetLineCap(), ccontext:SetDash(), and ccontext:StrokePreserve().

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