[svgwg] Issue: Bounding box algorithm is not precise marked as Co-ordinates chapter

dirkschulze has just labeled an issue for https://github.com/w3c/svgwg as "Co-ordinates chapter":

== Bounding box algorithm is not precise ==
The algorithm in [Bounding Boxes](https://svgwg.org/svg2-draft/coords.html#BoundingBoxes) describes how to compute the different boxes sizes depending on the booleans fill, stroke, markers, clipped.

However, with the exception of fill, all algorithms have the description:
> set _box_ to be the union of _box_ and [...]

However, _box_ is specified to get initialized as (0,0,0,0) and therefore has an actual value. If _box_ wasn't set to fill already, then all boxes will include the point (0,0) which is not what we want to have.

Maybe we should let each boolean initialize _box_ to the value returned by each operation if it isn't initialized already, otherwise create the union of _box_ and the specific rects.

If either none of the flags was set or no operation initialized/contributed to _box_, initialize it to (0,0,0,0) and return _box_.

Personal note: The dictionary might not be easy to feature detect. It might be quite some work to figure out which flag is supported by an implementation or not.

See https://github.com/w3c/svgwg/issues/422

Received on Sunday, 22 April 2018 10:41:51 UTC