Re: Bounding box of a group with a transformed child

On May 27, 2014, at 6:37 AM, Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de> wrote:
> Paul LeBeau:
> If one has a good algorithm to determine the boundingBox of an object
> without transformation, the extension to get it right for transformed objects
> should be a solvable problem (because one only has to transform all points 
> and control points of the equivalent paths of the objects and analyse this 
> instead).

You can bake the transforms into the path commands, and then calculate the BBox of those.
I got this mostly working ~3 years ago:
http://stackoverflow.com/questions/5149301/baking-transforms-into-svg-path-element-commands

You could then transform all path commands to absolute to make the bbox calc simpler:
http://phrogz.net/convert-svg-path-to-all-absolute-commands


> Obviously this is more difficult for the stroke of an object.

Correct. Nothing I’ve said above helps with the stroke.

Received on Tuesday, 27 May 2014 13:34:41 UTC