On 2011-12-29 0:38, Alvin Penner wrote:
On my machine, with this svg file, it takes 5 seconds to calculate the
bounding box. The time required depends on the stroke. If I change the stroke from 0.5 px to 10 px, it takes only 1 second, but changing back from 10 px to 0.5 px takes 8 seconds, using the Fill and Stroke editor to modify stroke. ... It appears that we need a compromise of sorts: if the path touches the (geometric) bbox tangentially, then we can ignore endcap style and use the half stroke width as in APPROXIMATE_BBOX (which is very fast), and if the path endpoint is touching the (geometric) bbox then we need to compensate for endcap style as is currently being done.
This is tricky, as we do not only need to take endpoints into account, but also corners of paths. I am a little surprised by your report that apparently calculating the bounding box takes an amount of time that depends on the stroke width. Or did I misunderstand your report?