W3C home > Mailing lists > Public > public-svg-wg@w3.org > January to March 2009

Re: Proposal for clarifying edge-cases for the rx and ry handling on the rect element

From: Cameron McCormack <cam@mcc.id.au>
Date: Wed, 25 Feb 2009 15:37:24 +1100
To: public-svg-wg@w3.org
Message-ID: <20090225043724.GA13173@arc.mcc.id.au>
Erik Dahlstrom:
> I was given ACTION-2367 to propose wording for clarifying the handling
> of rx and ry on rect elements[2].
…
> I propose to change that to the following algorithm (in pseudocode):
>
> if(rx)
>  clamp(rx, width/2)
>
> if(ry)
>  clamp(ry, height/2)
>
> if(rx && !ry) {
>  ry = rx;
>  clamp(ry, height/2);
> }
>
> if(!rx && ry) {
>  rx = ry;
>  clamp(ry, width/2);
> } 

I don’t have an opinion on whether clamping should happen in this order
or such that the two clamp() calls happen just before the assignment
statements they follow.

I’ll just briefly note though that the CSS3 Borders and Backgrounds
module defines clamping of box boder radii in a different way:

  http://dev.w3.org/csswg/css3-background/#the-border-radius

which is basically to reduce all four corner radii uniformly until they
fit, IIUC.

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Wednesday, 25 February 2009 04:38:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 February 2009 04:38:20 GMT