$i$ is the inner radius (input).
$s$ is the box shadow spread or margin (input)
$o$ is the outer radius (output)
If $i == 0$, then $o = 0$.
Otherwise, $o = i + s$.
If $i >= s$, then $o = i + s$.
Otherwise:
Let $p$ be, for the corner in question, the larger (of the two adjacent sides) portion of the side that is rounded. [note: $0 <= p <= 1$]
If $i >= s$, then $o = i + s$.
Otherwise:
Let $p$ be, for the corner in question, the larger (of the two adjacent sides) portion of the side that is rounded. [note: $0 <= p <= 1$]
If $i >= s$, then $o = i + s$.
Otherwise: