W3C home > Mailing lists > Public > public-svg-wg@w3.org > October to December 2010

Re: ISSUE-2384: Order of rx / ry computation for rounded rects [SVG Full 1.1]

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 1 Nov 2010 15:34:49 +1300
To: Erik Dahlstrom <ed@opera.com>
Cc: public-svg-wg@w3.org
Message-ID: <20101101023449.GK28301@wok.mcc.id.au>
Erik Dahlstrom:
> I would really like there to be some better wording in the spec for this,
> providing unambigous steps to follow to compute the effective value of
> rx and ry.

Yes.  Here is my suggested text to replace that paragraph:

  The values used for the x- and y-axis rounded corner radii are
  determined implicitly if the ‘rx’ or ‘ry’ attributes (or both)
  are not specified, or are specified but with invalid values.
  The values are also subject to clamping so that the lengths of
  the straight segments of the rectangle are never negative.  The
  effective values for ‘rx’ and ‘ry’ are determined by following
  these steps in order:

   1. Let rx and ry be length values.

   2. If neither ‘rx’ nor ‘ry’ are properly specified, then set both
      rx and ry to 0.  (This will result in square corners.)

   3. Otherwise, if a properly specified value is provided for ‘rx’, but
      not for ‘ry’, then set both rx and ry to the value of ‘rx’.

   4. Otherwise, if a properly specified value is provided for ‘ry’, but
      not for ‘rx’, then set both rx and ry to the value of ‘ry’.

   5. Otherwise, both ‘rx’ and ‘ry’ were specified properly.  Set rx to
      the value of ‘rx’ and ry to the value of ‘ry’.

   6. If rx is greater than half of ‘width’, then set rx to half of
      ‘width’.

   7. If ry is greater than half of ‘height’, then set ry to half of
      ‘height’.

   8. The effective values of ‘ry’ and ‘ry’ are rx and ry, respectively.

Verbose, perhaps, but hopefully clearer for dummies like me. :-)

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Monday, 1 November 2010 02:35:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 1 November 2010 02:35:28 GMT