Re: [csswg-drafts] [css-shapes] Specify algorithms for computing line-box intrusion into float's margin box.

Why not, tho? I don't see a particular reason why we need to allow differences in the result here, beyond trivial things like rounding?

SVG implementations already have solutions for computing the desired *shapes* (just take the implementation of the stroking algorithm, with `round` linejoins), which we can specify with more detail in the spec.

What's still needed beyond that is an explanation of how to find how far into the shape's bounding rect a linebox can penetrate without intersecting the shape. There are algorithms in the literature for doing this sort of line-sweep collision-finding for physics engines, but saying "it's defined in the literature, good luck!" isn't a very nice thing to do to implementors. (I tried that with something for gradients, and @SimonSapin made me actually define it. ^_^)  

A naive approach that doesn't work, for example, is to find where the top and bottom edges of the linebox would hit the shape, and use the one that's further out - this ignores the possibility of a "spike" between the two edges that should push the linebox even further. The actual efficient algorithm isn't particularly easy to puzzle out!

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2949#issuecomment-408195767 using your GitHub account

Received on Thursday, 26 July 2018 18:42:26 UTC