Re: [css-masking] CR from 2014-08-26: 'Appendix B: Compute stroke bounding box'

On Thu, Sep 4, 2014 at 6:59 AM, Dr. Olaf Hoffmann <Dr.O.Hoffmann@gmx.de>
wrote:

> Dirk Schulze:
> > “Inflate a rectangle” is an often used expression in computer science and
> > means that a rectangle is enlarged by a specified amount. The rectangle
> and
> > the amount are defined in the spec.
> >
> > Greetings,
> > Dirk
> >
>
> As already mentioned in the question about the draft, it is not obvious,
> how
> to 'Inflate box with the value of delta.'
> In this email I already guessed some method, how to enlarge the rectangle,
> but not sure, whether this is correct or that this results somehow in the
> intended box with some intuitive relation to the stroke of the shape (if
> this
> is really the task, not described at all in the CR for this feature).
>
> The current prose can result in different implementations for such an
> inflation - those may contain additive operations or multiplicative or even
> complex approximations or a mixture of all of this.
> The result is not necessarily always related to what I assume is intended:
> The smallest box aligned horizontally and vertically in the local
> coordinate
> system, that contains a stroked object or group of stroked objects (not
> excluding objects without stroke).
> Because there is no prose about such a purpose or functionality of a
> stroke bounding box, it is not even obvious, that my assumption is
> correct or that others may have other assumptions about this,
> especially due to the complexity of the problem to render combinations
> of stroke properties, even if stroke dashing is explicitly excluded.
>

The canvas 2d spec defines how to convert a stroked path into outlines:
http://www.w3.org/TR/2014/CR-2dcontext-20140821/#trace-a-path
Does that algorithm suffice? We've talked about referring to it to define
stroking in SVG.


> I still have a lot of fun examples with strange rendering results
> for objects where the width of a stroke is bigger than the typical
> diameter of the object - therefore I assume, that if there is no precise
> prose or formula for this, here we can get soon some more test-fun
> and surprises with non trivial examples for paths.
> 'Inflate box with the value of delta.'  is in general not testable, at
> least
> not with quantitative tests.
>
> Olaf
>
>
>
>

Received on Thursday, 4 September 2014 15:35:34 UTC