pathfinder icon indicating copy to clipboard operation
pathfinder copied to clipboard

cannot get bounding box of a path

Open hyasynthesized opened this issue 1 year ago • 2 comments

there's no way to get the bounding box of a path without cloning the path and calling into_outline on the clone. this is slow.

hyasynthesized avatar Mar 21 '24 20:03 hyasynthesized

the solution would be to add a get_bounds method to path which calls flush_current_contour and returns outline.bounds

hyasynthesized avatar Mar 21 '24 20:03 hyasynthesized

I assume you are talking about the Path in pathfinder_canvas ? It doesn't even need to call flush. Just call bounds() on the outlines and current_contour and compute their union.

s3bk avatar Mar 21 '24 20:03 s3bk