Re: [csswg-drafts] [css-shapes] Calculation of corner radii by margin-box and border-radius (#675)

What if `margin=0`? Then the ratio `border-radius/margin` is mathematically undefined, so I would handle it with `max(border-radius + margin, 0)`:

> If the margin is non-positive, or if the ratio of `border-radius/margin` is 1 or more, then the margin box corner radius is `max(border-radius + margin, 0)`. If the margin is positive, and the ratio of `border-radius/margin` is less than 1, then the margin box corner radius is `border-radius + (margin * (1 + (ratio-1)^3))`.

Note it checks the sign of margin before dividing by it, it's good practice.

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

Received on Wednesday, 23 October 2019 14:17:53 UTC