Add Tree::max_size to compute actual SVG size#944
Add Tree::max_size to compute actual SVG size#944JustForFun88 wants to merge 1 commit intolinebender:mainfrom
Tree::max_size to compute actual SVG size#944Conversation
|
Hmm, I'm not sure I'm convinced that we should have this method, it seems very specific. If anything, we should maybe adapt the documentation of |
That makes sense. I agree that updating the docs for Having a dedicated method like Tree::max_size is not strictly essential, but it does make things more convenient and helps avoid having to think about how to correctly calculate the actual SVG size. But this isn’t very important to me 😆, so I’m happy to go with whatever you think is best for the project |
|
I think updating the docs would be better, yes. |
|
Why do we need a one-line wrapper? |
This PR adds
Tree::max_sizeto easily get the final rendered size of an SVG, including all strokes, filters, and transforms.Motivation
This reduces boilerplate for anyone who needs the actual canvas size, for example when computing a scaling
Transformto fit the SVG into a target region and to help avoid memory overflows (see #814).